/**
 * Created by mx on 2023/12/15.
 */

//###########开业活动##########1
Comps.openactivity = function(config) {
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.activityName = config.activityName;
	this.activityRemark = config.activityRemark;
	this.imgSrc = config.imgSrc;
	this.defineUrl = config.defineUrl;
	this.defineWidth = config.defineWidth;
	this.defineHeight = config.defineHeight;
}

Comps.openactivity.prototype.GetQueryString = function(name) {

	 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;

}

Comps.openactivity.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
        $("#"+that.compId+"_img").attr("src",that.imgSrc);
        $("#"+that.compId+"_img").attr("width",that.defineWidth);
        $("#"+that.compId+"_img").attr("height",that.defineHeight);
        $("#"+that.compId+"_title").html(that.activityName);
        $("#"+that.compId+"_remark").html(that.activityRemark);
	}
	if(that.defineUrl != "" && that.defineUrl != null){
	    that.bindSomeEvent();
	}
    Utils.ajaxLoadComplate(that);
}

Comps.openactivity.prototype.bindSomeEvent=function(){
	var that=this;
        $("#"+that.compId+"_a").attr("href","javascript:void(0);");
	    $("#"+that.compId+"_a").click(function(){
	    window.open(ContextPath+that.defineUrl);
	})
}

//###########开业活动##########


//###########五星定制组件##########2
Comps.customization = function(config) {
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.name = config.name;
	this.content = config.content;
	this.imgSrc = config.imgSrc;
	this.defineWidth = config.defineWidth;
	this.defineHeight = config.defineHeight;
	this.linkUrl = config.linkUrl;
	this.customizedUuid= config.customizedUuid;
}


Comps.customization.prototype.init = function() {
	var that =this;
	var content = that.content ;
	if (this.needAsyncInit) {
	     $("#"+that.compId+"_a").attr("href",that.linkUrl+"?obsDesignId="+that.customizedUuid);
         $("#"+that.compId+"_img").attr("src",that.imgSrc);
         $("#"+that.compId+"_img").attr("width",that.defineWidth);
         $("#"+that.compId+"_img").attr("height",that.defineHeight);
         $("#"+that.compId+"_name").html(that.name);
         if(that.defineWidth < that.defineHeight){
            $("#"+that.compId).addClass("m-itembox");
         }
         $("#"+that.compId+"_describe").html(decodeURI($.base64.decode(content)));
	}
    Utils.ajaxLoadComplate(that);
}
//###########五星定制组件##########

//###########底部帮助中心组件###########3
Comps.HelpCenterComp = function(config) {
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.contentUrl = config.contentUrl;
	this.telephone = config.telephone;
	this.remark = config.remark;
	this.custom = config.custom;
}

Comps.HelpCenterComp.prototype.init = function() {
	var that =this;
	var contentUrl = that.contentUrl ;
	var compId = this.compId;
    if(that.needAsyncInit){
        $("#"+that.compId+"_telephone").html(that.telephone);
        $("#"+that.compId+"_custom").attr("href","javascript:NTKF.im_openInPageChat('jo_1000_9999')");
        $("#"+that.compId+"_remark").html(that.remark);
        $.ajax({
              type: "GET",
              url: ContextPath+"/helpcenter/ajaxLoadData",
              data: {},
              dataType: "json",
              success: function(data){
                  that.genCompHtml(data);
                  Utils.ajaxLoadComplate(that);
              }
        });
    }else{
        Utils.ajaxLoadComplate(that);
    }
}

Comps.HelpCenterComp.prototype.genCompHtml = function (data){
	var compId = this.compId;
	var contentUrl = this.contentUrl;
	 var htmlStr = "";
	 for(var i = 0;i<data.length;i++){
		 var cat = data[i].key;

		 htmlStr += "<dl>";
		 htmlStr += "<dt>"+cat.categoryName+"</dt>";
		 var conList = data[i].value;
		 for(var j=0;j<conList.length;j++){
			 var con = conList[j];
	    	 if(con.contentType == 1){
	    		 htmlStr +="<dd><a target='_blank' href='"+ContextPath+contentUrl+"/1/"+con.contentUuid+"'>"+con.contentTitle+"</a></dd>";
	    	 }
	    	 if(con.contentType == 2){
	    		 htmlStr += "<dd><a target='_blank' href='"+con.contentValue+"' >"+con.contentTitle+"</a></dd>";
	    	 }
		 }
		 htmlStr += "</dl>";
	 }
	 $("#"+compId+"_center").html(htmlStr);
}
//###########底部帮助中心组件###########

//###########底部组件###########4
Comps.FooterComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
}

Comps.FooterComp.prototype.init = function(){
	var that = this;
	var windowH = $(window).height();
    $(window).scroll(function () {
        var scroTop = $(window).scrollTop() + 100;
        if(scroTop > 767) {
            $('.m_backtop').show()
        }else {
            $('.m_backtop').hide()
        }
    })
	$('.m_backtop').click(function () {
        $('html,body').animate({'scrollTop': 0}, 800);
    })
    //底部图标hover
    $('.footer-wechat a').hover(function () {
        $(this).addClass('active')
    },function () {
        $(this).removeClass('active')
    })
}
//###########底部组件###########

//###########首页品牌资讯###########5
Comps.BrandInformationComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.categoryUuid = config.categoryUuid;
    this.parentUuid = config.parentUuid;
    this.moreUrl = config.moreUrl;
    this.detailUrl = config.detailUrl;
}

Comps.BrandInformationComp.prototype.init = function() {
	var that =this;
	var categoryUuid = that.categoryUuid ;
	var compId = this.compId;
	//$("#"+compId+"_more").attr("href",that.moreUrl);
    if(that.needAsyncInit){
        $.ajax({
              type: "GET",
              url: ContextPath+"/brandInformation/ajaxLoadData",
              data: {"categoryUuid":categoryUuid},
              dataType: "json",
              success: function(data){
                  that.genCompHtml(data);

                  Utils.ajaxLoadComplate(that);
              }
        });
    }else{
        Utils.ajaxLoadComplate(that);
    }
}

Comps.BrandInformationComp.prototype.genCompHtml = function (data){
    var that =this;
     var compId = this.compId;
	 var htmlStr = "";
	 if(data != null && data.length > 0){
	   htmlStr += "<ul class='m-brandsnew', id='j_conent'>";
	   for(var j=0;j<data.length;j++){
	      var detailUrl = that.detailUrl+"/"+data[j].contentId+".htm" ;
          htmlStr += "<li><p class='p1'>"+data[j].createTime.substr(0,5)+"</p>";
          htmlStr += "<p class='p2'>"+data[j].createTime.substr(6,data[j].createTime.length-1)+"</p>";
          htmlStr += "<div class='m-tit'><h4><a href='"+detailUrl+"'>"+data[j].contentTitle+"</a></h4>";
          htmlStr += "<p><a href='"+detailUrl+"'>"+data[j].note+"</a></p>";
          htmlStr += "</div></li>";
       }
       htmlStr += "</ul>";
	 }
	 var moreUrl = that.moreUrl+"?parentUuid="+that.parentUuid+"&categoryUuid="+that.categoryUuid ;
	 htmlStr += "<div class='m-brandsnew-btn'><a href='"+moreUrl+"' class='butn butn_custom2'>more</a></div>";
	 $(".m-brandsnew").remove();
     $(".m-brandsnew-btn").remove();
	 $("#"+compId).append(htmlStr);
}
//###########首页品牌资讯###########

//###########联系我们标题组件###########6
Comps.ContactUsComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.title = config.title;
    this.remark = config.remark;
}

Comps.ContactUsComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
        $("#"+that.compId+"_title").html(that.title);
        $("#"+that.compId+"_remark").html(that.remark);
	}
    Utils.ajaxLoadComplate(that);
}
//###########联系我们标题组件###########

//###########联系我们组件###########7
Comps.ServiceContactComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.title = config.title;
    this.describe = config.describe;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
    this.isShowServiceImg = config.isShowServiceImg;
    this.showUrl = config.showUrl;

}

Comps.ServiceContactComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	    $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
        $("#"+that.compId+"_title").html(that.title);
        $("#"+that.compId+"_describe").html(decodeURI($.base64.decode(that.describe)));
	}
    //加上美心官方微博地址
    var showUrl = that.showUrl;
    if(showUrl){
        that.bindEvent();
    }
    //二维码图片地址
    var isShowServiceImg = that.isShowServiceImg;
    if(isShowServiceImg){
        $.ajax({
            type: "GET",
            url: ContextPath+"/serviceContact/getWxServiceImg",
            data: {},
            dataType: "json",
            success: function(data){
                var wxServiceImg = data.wxServiceImg;
                if(wxServiceImg){
                    $("#"+that.compId+"_serviceimg").html("<div  class='y_serviceimg'>美心管家服务号<br><img src='"+wxServiceImg+"'></div>");
                }
            }
        });


    }
    Utils.ajaxLoadComplate(that);
}

Comps.ServiceContactComp.prototype.bindEvent=function(){
    var that=this;
    $("#"+that.compId+"_title").css("cursor","pointer");
    $("#"+that.compId+"_title").click(function(){
        window.open(that.showUrl);
    })

}

//###########承诺书组件###########8
Comps.CommitmentComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.logo = config.logo;
    this.commitment = config.commitment;
    this.linkUrl = config.linkUrl;
    this.contentCategoryUuid = config.contentCategoryUuid;
}

Comps.CommitmentComp.prototype.init = function() {
	var that =this;
	var contentCategoryUuid = this.contentCategoryUuid;
	var url = this.linkUrl;
	if (this.needAsyncInit) {
	    $.ajax({
            type: "GET",
            url: ContextPath+"/commitment/ajaxLoadData",
            data: {"contentCategoryUuid":contentCategoryUuid},
            dataType: "json",
            success: function(data){
                if(url.indexOf("/") == 0){
                    $("#"+that.compId+"_a").attr("href",that.linkUrl+"/"+data.uuid);
                }else{
                    $("#"+that.compId+"_a").attr("href",that.linkUrl);
                }
                $("#"+that.compId+"_logo").html(that.logo);
                $("#"+that.compId+"_commitment").html(that.commitment);
            }
        });
	}
    Utils.ajaxLoadComplate(that);
}
//###########承诺书组件###########

//###########服务政策组件###########9
Comps.ServicePolicyComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.positionFlag = config.positionFlag;
    this.serviceName = config.serviceName;
    this.content = config.content;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.ServicePolicyComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	    if(this.positionFlag){
            $("#"+that.compId+"_pic").before($("#"+that.compId+"_info"));
        }

	    $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
      $("#"+that.compId+"_title").html(that.serviceName);
      $("#"+that.compId+"_content").html(decodeURI($.base64.decode(that.content)));
	}
    Utils.ajaxLoadComplate(that);
}
//###########服务政策组件###########

//###########所需的服务组件###########10
Comps.ServiceComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.serviceName = config.serviceName;
    this.content = config.content;
    this.linkUrl = config.linkUrl;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.ServiceComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	    $("#"+that.compId+"_a").attr("href",that.linkUrl).append(decodeURI($.base64.decode(that.content)));
	    $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
        $("#"+that.compId+"_title").html(that.serviceName);
	}
    Utils.ajaxLoadComplate(that);
}
//###########所需的服务组件###########

//###########美心简介组件###########11
Comps.AboutUsComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.introduce = config.introduce;
}

Comps.AboutUsComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	   $("#"+that.compId).html(decodeURI($.base64.decode(that.introduce)))
	}
    Utils.ajaxLoadComplate(that);
}
//###########美心简介组件###########

//###########美心智造组件###########12
Comps.BrandWisdomComp = function(config){
	this.compId = config.compId;
        this.needAsyncInit = config.needAsyncInit;
        this.title = config.title;
        this.describe = config.describe;
        this.imgSrc = config.imgSrc;
        this.defineWidth = config.defineWidth;
        this.defineHeight = config.defineHeight;
        this.linkUrl = config.linkUrl ;
}

Comps.BrandWisdomComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	    $("#"+that.compId+"_a").attr("href",that.linkUrl);
	    $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
        $("#"+that.compId+"_title").attr("href",that.linkUrl).html(that.title);
        $("#"+that.compId).append(decodeURI($.base64.decode(that.describe)));

	}
    Utils.ajaxLoadComplate(that);
}
//###########美心智造组件###########

//###########品牌资讯Tab组件###########13
Comps.BrandInformationTabComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.categoryUuid = config.categoryUuid;
    this.detailUrl = config.detailUrl;
    this.moreUrl = config.moreUrl;
}

Comps.BrandInformationTabComp.prototype.init = function() {
	var that =this;
	var categoryUuid = that.categoryUuid ;
	var compId = this.compId;
    if(that.needAsyncInit){
        $.ajax({
              type: "GET",
              url: ContextPath+"/brandInformationTab/ajaxLoadData",
              data: {"categoryUuid":categoryUuid},
              dataType: "json",
              success: function(data){
                  that.genCompHtml(data);
                  Utils.ajaxLoadComplate(that);
                  that.bindSomeEvent();
              }
        });
    }else{
        that.bindSomeEvent();
        Utils.ajaxLoadComplate(that);
    }
}

Comps.BrandInformationTabComp.prototype.genCompHtml = function (data){
    var that =this;
     var compId = this.compId;
     var tabList = data["tabList"];
     //得到所有内容的set集合
     var contentSet = data["contentSet"];

	 var htmlStr = "";
	 if(tabList != null && tabList.length > 0){
	    for(var i=0;i<tabList.length;i++){
	        if(i==0){
	            htmlStr += "<li class='active'>"+tabList[i].categoryName+"</li>";
	        }else{
                htmlStr += "<li>"+tabList[i].categoryName+"</li>";
           }
	    }
	    $(".y_brandtab").html(htmlStr);
	 }else{
	    $(".y_brandtab").html("");
	 }
	 if(contentSet != null && contentSet.length > 0){
	    that.initCompHtml(contentSet,tabList);
	 }
}

Comps.BrandInformationTabComp.prototype.initCompHtml = function (contentSet,tabList){
	var that =this;
	var htmlStr1 = "" ;
	for(var i=contentSet.length-1;i>=0;i--){
	    var contentList = contentSet[i];
	    var detailUrl = that.detailUrl+"/"+contentList.uuid ;
        if(i == contentSet.length-1){
            htmlStr1 += "<ul class='m-brandsnew2 f-dn' style='display:block;'>";
        }else{
            htmlStr1 += "<ul class='m-brandsnew2 f-dn' style='display:none;'>";
        }
        if(contentList.length > 3){
            for(var j=0;j<3;j++){
                htmlStr1 += "<li><p class='p1'>"+contentList[j].createTime.substr(0,5)+"</p>";
                htmlStr1 += "<p class='p2'>"+contentList[j].createTime.substr(6,contentList[j].createTime.length-1)+"</p>";
                htmlStr1 += "<div class='m-tit'><h4><a href='"+detailUrl+"'>"+contentList[j].contentTitle+"</a></h4>";
                htmlStr1 += "<p><a href='"+detailUrl+"'>"+contentList[j].note+"</a></p>";
                htmlStr1 += "</div></li>";
            }
            htmlStr1 += "</ul>"
        }else{
            for(var j=0;j<contentList.length;j++){
                htmlStr1 += "<li><p class='p1'>"+contentList[j].createTime.substr(0,5)+"</p>";
                htmlStr1 += "<p class='p2'>"+contentList[j].createTime.substr(6,contentList[j].createTime.length-1)+"</p>";
                htmlStr1 += "<div class='m-tit'><h4><a href='"+detailUrl+"'>"+contentList[j].contentTitle+"</a></h4>";
                htmlStr1 += "<p><a href='"+detailUrl+"'>"+contentList[j].note+"</a></p>";
                htmlStr1 += "</div></li>";
            }
            htmlStr1 += "</ul>"
        }

    }
    if(tabList != null && tabList.length > 0){
        var url = that.moreUrl+"?parentUuid="+that.categoryUuid;
        htmlStr1 += "<div class='m-brandsnew-btn'><a href='"+url+"' class='butn butn_custom2'>more</a></div>";
    }else{
        htmlStr1 += "<div class='m-brandsnew-btn'></div>";
    }
    $(".m-brandsnew2").remove();
    $(".m-brandsnew-btn").remove();
    $(".y_brandtab").after(htmlStr1);
}

Comps.BrandInformationTabComp.prototype.bindSomeEvent=function(){
	var that=this;
	// 品牌资讯切换
    $(".y_brandtab li").hover(function(){
        $(this).addClass("active").siblings().removeClass("active");
        $(".m-brandsnew2").eq($(this).index()).show().siblings(".m-brandsnew2").hide();
    });
}

//###########品牌资讯Tab组件###########

//###########智慧浴室组件###########14
Comps.WisdomBathroomComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.pictureName = config.pictureName ;
    this.content = config.content;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.WisdomBathroomComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	    $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
        $("#"+that.compId+"_title").html(that.pictureName);
        $("#"+that.compId).append(decodeURI($.base64.decode(that.describe)));
	}
    Utils.ajaxLoadComplate(that);
}
//###########智慧浴室组件###########

//###########健康龙头组件###########15
Comps.HealthTapComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.content = config.content;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.HealthTapComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	    $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
        $("#"+that.compId+"_title").html(that.pictureName);
        $("#"+that.compId).append(decodeURI($.base64.decode(that.describe)));
	}
    Utils.ajaxLoadComplate(that);
}
//###########健康龙头组件###########

//##########浴室柜组件###########16
Comps.BathroomCabinetComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.name = config.name;
    this.englishName = config.englishName;
    this.subhead = config.subhead;
    this.content = config.content;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.BathroomCabinetComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	    $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
        $("#"+that.compId+"_title").html(that.name);
        $("#"+that.compId+"_english").html(that.englishName);
        $("#"+that.compId+"_subhead").html(that.subhead);
        $(".j_content").append(decodeURI($.base64.decode(that.describe)));
	}
    Utils.ajaxLoadComplate(that);
}
//###########浴室柜组件###########

//##########广告设计组件###########17
Comps.AdvertisementDesignComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.positionFlag = config.positionFlag;
    this.content = config.content;
    this.name = config.name;
    this.remark = config.remark;
    this.content = config.content;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.AdvertisementDesignComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {

        if(this.positionFlag){
           $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
           $("#"+that.compId+"_title").html(that.name);
           $("#"+that.compId+"_abstract").html(that.remark);
           $(".j_content").append(decodeURI($.base64.decode(that.describe)));
        }else{
            $("#j_content").before($("#j_img"));
            $("#j_content").addClass("design-button");
            $("#j_img").addClass("design-button");
            $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
            $("#"+that.compId+"_title").html(that.name);
            $("#"+that.compId+"_abstract").html(that.remark);
            $(".j_content").append(decodeURI($.base64.decode(that.describe)));
        }


	}
    Utils.ajaxLoadComplate(that);
}
//###########广告设计组件###########


//##########商务Log组件###########18
Comps.BusinessLogComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.logName = config.logName;
    this.link = config.link;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.BusinessLogComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	    $("#"+that.compId+"_a").attr("href",that.link);
	    $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
        $("#"+that.compId+"_title").html(that.logName);
	}
    Utils.ajaxLoadComplate(that);
}
//##########商务Log组件###########

//##########商务对接组件###########19
Comps.BusinessMatchmakingComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.name = config.name;
    this.link = config.link;
    this.bgImgSrc = config.bgImgSrc;
    this.bgDefineWidth = config.bgDefineWidth;
    this.bgDefineHeight = config.bgDefineHeight;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.BusinessLogComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	    $("#"+that.compId+"_businessioc").html("");
	    $("#"+that.compId+"_link").attr("href",that.link);
	    $("#"+that.compId+"_bgImg").attr("src",that.bgImgSrc).attr("width",that.bgDefineWidth).attr("height",that.bgDefineHeight);
        var html= "<s><img id='$_businessMatchmakingComp_compId_img' src='"+that.imgSrc+"' width='"+that.defineWidth+"' height='"+that.defineHeight+"'></s>"+this.name+"<span></span>" ;
        $("#"+that.compId+"_businessioc").html(html);
	}
    Utils.ajaxLoadComplate(that);
}
//##########商务对接组件###########

//##########右侧导航组件###########20
Comps.FixedRightComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.serviceUrl = config.serviceUrl;
    this.phoneUrl = config.phoneUrl;
    this.installUrl = config.installUrl;
    this.backTop = config.backTop;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.FixedRightComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
       $("#"+that.compId+"_service").attr("href",that.serviceUrl);
       $("#"+that.compId+"_phone").attr("href",that.phoneUrl);
       $("#"+that.compId+"_img").attr("src",that.bgImgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
       $("#"+that.compId+"_install").attr("href",that.installUrl);
       if(that.backTop == ""){
            $("#"+that.compId+"_backTop").attr("href","#");
       }else{
            $("#"+that.compId+"_backTop").attr("href",that.backTop);
       }

	}
    Utils.ajaxLoadComplate(that);
}
//##########右侧导航组件###########

//##########品牌导航导航组件###########
Comps.BrandNavigationComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.categoryUuid = config.categoryUuid;
}
Comps.BrandNavigationComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
       $.ajax({
             type: "GET",
             url: ContextPath+"/brandNavigation/ajaxLoadData",
             data: {"categoryUuid":this.categoryUuid},
             dataType: "json",
             success: function(data){
                that.genCompHtml(data);
             }
       });
	}
    Utils.ajaxLoadComplate(that);
}

Comps.BrandNavigationComp.prototype.genCompHtml = function (data){
	var compId = this.compId;
    if(data.ccm.categoryUrl != null && data.ccm.categoryUrl != ""){
        $("#"+compId+"_title").attr("href",data.ccm.categoryUrl).html(data.ccm.categoryName);
    }else{
        $("#"+compId+"_title").html(data.ccm.categoryName);
    }
    var html = "" ;
    if(data.list != null && data.list.length > 0){
        $("#"+compId+"_header").html("");
        for(var i=0; i<data.list.length ;i++){
            html += "<a class='j_brandNavigationTab' href='"+data.list[i].categoryUrl+"'>"+data.list[i].categoryName+"</a>";
        }
    }
    $("#"+compId+"_header").html(html);
}
//##########品牌导航导航组件###########

//##########相关视频组件###########
Comps.RelatedVideoComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.videoName = config.videoName;
    this.videoUrl = config.videoUrl;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.RelatedVideoComp.prototype.init = function() {
	var that =this;
    that._bindEvent();
	if (this.needAsyncInit) {
	    $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
	    $("#"+that.compId+"_title").html(that.videoName);
	}
}

Comps.RelatedVideoComp.prototype._bindEvent = function () {
    var that = this;
    $("#"+that.compId + " li").click(function(){
        var htmlStr = "<source src='"+that.videoUrl+"' type='video/mp4'>您的浏览器不支持video标签";
        $("#"+that.compId + "_video").html(htmlStr);

        $("#"+that.compId+"_videoPath").attr("src",that.videoUrl);
        $("#"+that.compId+"_play").show();
        $("body").append("<div class='modal-backdrop in'></div>");
    });
    $("body").on("click",".modal-backdrop",function(){
        $(".modal-backdrop").remove();
        $("#"+that.compId+"_play").hide();

        var myVideo = document.getElementById(that.compId+'_video');   //获取视频video
        if (myVideo.paused){
            myVideo.play();
        }else{
            myVideo.pause();
        }
    })

}
//##########相关视频组件###########


//##########花洒组件###########
Comps.ShowerComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.name = config.name;
    this.content = config.content;
    this.bgImgSrc = config.bgImgSrc;
    this.bgDefineWidth = config.bgDefineWidth;
    this.bgDefineHeight = config.bgDefineHeight;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.ShowerComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
	    $("#"+that.compId+"_title").html(that.name);
	    $("#"+that.compId+"_content").html("");
	    $("#"+that.compId+"_content").html(decodeURI($.base64.decode(that.content)));
	    $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
	    $("#"+that.compId+"_bgImg").attr("src",that.bgImgSrc).attr("width",that.bgDefineWidth).attr("height",that.bgDefineHeight);
	}
}
//##########花洒组件###########


//##########智慧浴室优点组件###########
Comps.BathroomAdvantageComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.categoryUuid = config.categoryUuid;
}

Comps.BathroomAdvantageComp.prototype.init = function() {
	var that =this;
	if (this.needAsyncInit) {
       $.ajax({
             type: "GET",
             url: ContextPath+"/bathroomAdvantage/ajaxLoadData",
             data: {"categoryUuid":this.categoryUuid},
             dataType: "json",
             success: function(data){
                that.genCompHtml(data);
                that._bindEvent();
             }
       });
	}else{
	that._bindEvent();
    }
    Utils.ajaxLoadComplate(that);
}
Comps.BathroomAdvantageComp.prototype.genCompHtml = function (data){
	var compId = this.compId;
	var html = "" ;
    if(data != null && data.length > 0 ){
        $("#"+compId+"_ul").html("");
        for(var i = 0; i < data.length ; i++){
            html += "<li>" ;
            html += "<span class='lookImg'> <img id='bgImage' src='"+ data[i].iconPath +"'> </span>" ;
            html += " <p class='capacity-title'>"+data[i].contentTitle+"<span>"+data[i].pageKey+"</span></p>";
            html += "<div class='capacity-one'><i></i></div>" ;
            html += "<p>"+data[i].note+"</p></li>";
        }
    }
    $("#"+compId+"_ul").html(html);
}

Comps.BathroomAdvantageComp.prototype._bindEvent = function () {
   if($('.capacity-gobox.owl-carousel').length && $.fn.owlCarousel){
   		$('.capacity-gobox.owl-carousel').owlCarousel({
   		   items:4,
   		   itemsDesktop:false,
   		   itemsDesktopSmall:false,
   		   itemsTablet:false,
   		   navigation: true,
   		   navigationText: false,
   		   pagination: false,
   		   slideSpeed: 500
   	  });
   	};
}
//##########智慧浴室优点组件###########


//##########智慧浴室优点组件###########
Comps.FeaturesComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.number = config.number;
    this.title = config.title;
    this.trait = config.trait;
    this.imgSrc = config.imgSrc;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
}

Comps.FeaturesComp.prototype.init = function() {
    var that = this ;
    if (this.needAsyncInit) {
        if("1" == that.number){
            $(".health-right-t").addClass("right-t-a");
        }else if("2" == that.number){
            $(".health-right-t").addClass("right-t-b");
        }else if("3" == that.number){
            $(".health-right-t").addClass("right-t-c");
        }else if("4" == that.number){
            $(".health-right-t").addClass("right-t-d");
        }
        if (that.number == '' || that.number == null || that.number == undefined) {
          $("#"+that.compId+"_number").html("");
        }else{
          $("#"+that.compId+"_number").html(that.number+"/");
        }

        $("#"+that.compId+"_title").html(that.title);
        $("#"+that.compId+"_trait").html(that.trait);
        $("#"+that.compId+"_img").attr("src",that.imgSrc).attr("width",that.defineWidth).attr("height",that.defineHeight);
    }
}
//##########智慧浴室优点组件###########

//##########定制流程组件###########
Comps.makeToProcessComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.customUrl = config.customUrl;
	this.fristName = config.fristName;
    this.secondName = config.secondName;
    this.thirdName = config.thirdName;
    this.fourthName = config.fourthName;
}

Comps.makeToProcessComp.prototype.init = function() {
    var that = this ;
    if (this.needAsyncInit) {
        $("#"+that.compId).attr("href",that.customUrl);
        $("#"+that.compId+"_first").html(that.fristName);
        $("#"+that.compId+"_second").html(that.secondName);
        $("#"+that.compId+"_third").html(that.thirdName);
        $("#"+that.compId+"_fourth").html(that.fourthName);
    }
    Utils.ajaxLoadComplate(that);
}
//##########定制流程组件结束###########

//##########五星定制广告组件###########
Comps.customAdComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.firstImg = config.firstImg;
	this.secondImg = config.secondImg;
    this.thirdImg = config.thirdImg;
    this.fourthImg = config.fourthImg;
    this.fiveImg = config.fiveImg;
    this.sixImg = config.sixImg;
}

Comps.customAdComp.prototype.init = function() {
    var that = this ;
    if (this.needAsyncInit) {
        $("#"+that.compId+"_first").attr("src",that.firstImg).attr("width","140").attr("height","60");
        $("#"+that.compId+"_second").attr("src",that.secondImg).attr("width","140").attr("height","60");
        $("#"+that.compId+"_third").attr("src",that.thirdImg).attr("width","140").attr("height","60");
        $("#"+that.compId+"_fourth").attr("src",that.fourthImg).attr("width","140").attr("height","60");
        $("#"+that.compId+"_five").attr("src",that.fiveImg).attr("width","140").attr("height","60");
        $("#"+that.compId+"_six").attr("src",that.sixImg).attr("width","140").attr("height","60");
    }
    Utils.ajaxLoadComplate(that);
}
//##########五星定制广告组件结束###########

//##########设计师组件###########
Comps.designerComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
}

Comps.designerComp.prototype.init = function() {
    var that = this ;
    if (this.needAsyncInit) {
        $.ajax({
              type: "GET",
              url: ContextPath+"/designer/ajaxLoadData",
              data: {},
              dataType: "json",
              success: function(data){
              that.slide();
                  that.genCompHtml(data);
                  Utils.ajaxLoadComplate(that);
              }
        });
    }
    that.slide();
    Utils.ajaxLoadComplate(that);
     //绑定事件
    that._bindEvent();
}

Comps.designerComp.prototype.genCompHtml = function (data){
	var compId = this.compId;
	var html = "" ;
    if(data != null && data.length > 0 ){
        $("#"+compId+"_designerUl").html("");
        for(var i = 0; i < data.length ; i++){
            html += "<li id='$_designerComp_compId_designerLi' class='r-lbt'>" ;
            html += "<div class='r-header-down'></div> <div class='r-header-up'>";
            html += "<img id='$_designerComp_compId_img' src='"+data[i].designerImg+"' style='height:180px;width:180px;' alt='' draggable='false'> </div>"
            html += "<div class='c-referral'><p id='$_designerComp_compId_name' class='r-name'>"+data[i].name+"</p>" ;
            html += "<p id='$_designerComp_compId_relationship'>"+data[i].appuid+"</p>";
            html += "<p id='$_designerComp_compId_note' class='r-text'><i></i>"+data[i].note+"</p></div></li>";
        }
    }
    $("#"+compId+"_designerUl").html(html);
}

Comps.designerComp.prototype.slide = function() {
	$('.flexslider').flexslider({
		animation: "fade",
		animationLoop: true,
		slideToStart: 5,
		startAt:0,
		pauseOnAction: true,
		pauseOnHover: false,
		slideshowSpeed: 4000
	});
}

Comps.designerComp.prototype._bindEvent = function () {
    var flag = true;
    if(navigator.userAgent.indexOf("MSIE") > 0){
        if(navigator.userAgent.indexOf("MSIE 8.0") > 0){
            flag = false;
        }
    }
    if(!flag){
        $(".custom-flow").css("border","1px solid #000");
    }
}
//##########设计师组件结束###########

//##########定制tab组件###########
Comps.customizationTabComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.seniorLink = config.seniorLink;
}

Comps.customizationTabComp.prototype.init = function() {
    var that = this ;
    if (this.needAsyncInit) {
        $("#"+that.compId+"_seniorLink").attr("href",that.seniorLink);
    }
    Utils.ajaxLoadComplate(that);
    that._bindEvent();
}

Comps.customizationTabComp.prototype._bindEvent = function () {
    var ts = this;
    var compId = this.compId;
    $(".query_btn").click(function(){
        var schemeType = $(this).attr("dataId");
        $("#schemeType").val(schemeType);
         var option ={"schemeType":schemeType,"programTemplateUuid":"","areaId":""};
        $(".c-blue").removeClass();
        $(this).addClass("c-blue");
        //发布五星定制切换主题
        CompMessage.publish('catTab',option,function(data){
        });
    });
}
//##########定制tab组件结束###########

//##########方案筛选组件###########
Comps.programScreeningComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
}

Comps.programScreeningComp.prototype.init = function() {
    var that = this ;
    if (this.needAsyncInit) {

    }
    Utils.ajaxLoadComplate(that);
    that._bindEvent();
}

Comps.programScreeningComp.prototype._bindEvent = function () {
    var ts = this;
    var compId = this.compId;
    $("#style_all").click(function(){
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = "" ;
        var areaId =$("#areaId").val();
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId};
        $("#styleId").val(programTemplateUuid);
        $(".active").removeClass("active");
        $(this).addClass("active");
        $("#style_btn").html("");
        ts.screening(option);
    });

    $("#area_all").click(function(){
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = $("#styleId").val() ;
        var areaId = "";
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId};
        $("#areaId").val(areaId);
        $(".active").removeClass("active");
        $(this).addClass("active");
        $("#area_btn").html("");
        ts.screening(option);
    });

    $(".style_btn").click(function(){
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = $(this).attr("programTemplateUuid");
        var areaId =$("#areaId").val();
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId};
        $("#styleId").val(programTemplateUuid);
        $(".active").removeClass("active");
        $(this).addClass("active");
        var name = $(this).text();
        $("#style_btn").html(name+"<s class='style_btn close_fillet'>×</s>");
        ts.screening(option);

    });

    $(".area_btn").click(function(){
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = $("#styleId").val() ;
        var areaId =$(this).attr("areaId");
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId};
        $("#areaId").val(areaId);
        $(".active").removeClass("active");
        $(this).addClass("active");
        var name = $(this).text();
        ts.screening(option);
        $("#area_btn").html(name+"<s class='area_btn close_fillet'>×</s>");
    });

    $("#area_btn").click(function(){
       var schemeType = $("#schemeType").val();
       var programTemplateUuid = $("#styleId").val() ;
       var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":""};
       $("#areaId").val("");
       $(".active").removeClass("active");
       ts.screening(option);
       $("#area_btn").html("");
    });

    $("#style_btn").click(function(){
       var schemeType = $("#schemeType").val();
       var areaId =$(this).attr("areaId");
       var option ={"schemeType":schemeType,"programTemplateUuid":"","areaId":areaId};
       $("#styleId").val("");
       $(".active").removeClass("active");
       ts.screening(option);
        $("#style_btn").html("");
    });

    $("#clean_btn").click(function(){
       var schemeType = $("#schemeType").val();
       var option ={"schemeType":schemeType,"programTemplateUuid":"","areaId":""};
       $("#areaId").val("");
       $("#styleId").val("");
       $(".active").removeClass("active");
       ts.screening(option);
       $("#style_btn").html("");
       $("#area_btn").html("");
    });

}
Comps.programScreeningComp.prototype.screening = function (option) {
    var that = this;
    var compId = this.compId;
    //发布五星定制筛选主题
    CompMessage.publish('screening',option,function(data){
    });
}
//##########方案筛选组件结束###########

//##########定制列表组件###########
Comps.programmeDetailComp = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.customLink = config.customLink;
	this.purchaseLink = config.purchaseLink;
}
Comps.programmeDetailComp.prototype.init = function() {
    var uri = window.location.href;
    var that = this ;

    if (this.needAsyncInit) {
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = "";
        var areaId = "";
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId};
        that.ajaxLoadData(option);
    }else{
        Utils.ajaxLoadComplate(that);
        that._bindEvent();
    }

    CompMessage.subscribe("catTab",function(option,callback){
      that.ajaxLoadData(option);
   });

   CompMessage.subscribe("screening",function(option,callback){
        that.ajaxLoadData(option);
   });

}

Comps.programmeDetailComp.prototype.ajaxLoadData = function (option) {
    var ts = this;
    var compId = this.compId;

    $.ajax({
        "url": ContextPath+"/programmeList/ajaxLoadData.json",
        "data" : option,
        "success": function (data) {
            var customizedProgram = data.programmePageModel.customizedProgramList;
            if(customizedProgram != null && customizedProgram.length > 0){
                $("#"+compId+"_list").html("");
                var html = "";
                for(var i = 0;i < customizedProgram.length; i++){
                    var productUuid = customizedProgram[i].uuid ;
                    var renderImage = customizedProgram[i].renderImage ;
                    var note = customizedProgram[i].name ;
                    var obsDesignId = customizedProgram[i].obsDesignId ;
                    var customUrl = ContextPath+ts.customLink+"?obsDesignId="+obsDesignId;
                    var purchaseUrl = ContextPath+ts.purchaseLink+"?obsDesignId="+obsDesignId;
                    html += "<li><div class='custom-img'>";
                    html += "<a href='"+purchaseUrl+"'><img src='"+renderImage+"'></a></div><div class='custom-click'>";
                    html += "<p><a href='"+purchaseUrl+"'>"+note+"</a></p><div class='custom-btn'>";
                    html += "<a class='c-btn-l' href='"+customUrl+"'>立即定制</a>";
                    html += "<a class='c-btn-r' href='"+purchaseUrl+"'>立即购买</a>";
                    html += "</div></div></li>"
                }
                $("#"+compId+"_list").html(html);

                var page = 0;
                var totalPage = data.programmePageModel.totalNum ;
                var page1 = data.programmePageModel.pageShow ;
                if(parseInt(totalPage)%parseInt(page1) == 0){
                    page = (parseInt)(totalPage/page1);
                }else{
                    page = (parseInt)(totalPage/page1)+parseInt(1);
                }
                $("#"+compId+"_page").html("");

                var html1 = "<input id='totalPage' type='text' style='display:none;' value='"+page+"'><a class='first_btn y_btn' href='javascript:void(0)'>首页</a>";
                html1 += "<a class='last_btn y_btn disabled' href='javascript:void(0)'>上一页</a>";
                for(var i=1 ; i <= page ; i++){
                    if(page <= 4){
                        if(i == 1){
                            html1 += "<a class='page_turn y_cur' href='javascript:void(0);' title='第1页'>1</a>" ;
                        }else if(i == 2){
                            html1 += "<a class='page_turn' href='javascript:void(0);' title='第2页'>2</a>";
                        }else if(i == 3){
                            html1 += "<a class='page_turn' href='javascript:void(0);' title='第3页'>3</a>";
                        }else{
                            html1 += "<a class='page_turn' href='javascript:void(0);' title='第4页'>4</a>";
                        }
                    }else{
                        if(i == 1){
                            html1 += "<a class='y_cur' href='javascript:void(0);' title='第1页'>1</a>" ;
                        }else if(i == 2){
                            html1 += "<a href='javascript:void(0);' title='第2页'>2</a>";
                        }else if(i == 3){
                            html1 += "<a href='javascript:void(0);' title='第3页'>3</a>";
                        }else{
                            html1 += "<span class='y_spit'>...</span>";
                            html1 += "<a href='javascript:void(0);' title='第''"+i+"''页'>"+i+"</a>";
                        }
                    }
                }
                if(page == 1){
                    html1 += "<a class='next_btn y_btn disabled' href='javascript:void(0);' title='下一页'>下一页</a>" +
                            "<a class='end_btn y_btn disabled' href='javascript:void(0);' title='尾页'>尾页</a>" ;
                }else{
                    html1 += "<a class='next_btn y_btn' href='javascript:void(0);' title='下一页'>下一页</a>" +
                            "<a class='end_btn y_btn' href='javascript:void(0);' title='尾页'>尾页</a>" ;
                }
                html1 +="<span class='y_tzpl'>共"+page+"页</span>到第" +
                        "<span class='y_pagenumber'>" +
                        "<b class='y_num'>1</b><ul id='page_btn'>";
                for(var i=1 ; i<=page ; i++){
                    html1 += "<li>"+i+"</li>";
                }
                html1 += "</ul></span>页";
                $("#"+compId+"_page").html(html1);
            }else{
                 $("#"+compId+"_list").html("暂无您想要的数据");
                 $("#"+compId+"_page").html("");
            }
            ts._bindEvent();
        }
    });
}

Comps.programmeDetailComp.prototype.loadData = function (option) {
    var ts = this;
    var compId = this.compId;

    $.ajax({
        "url": ContextPath+"/programmeList/ajaxLoadData.json",
        "data" : option,
        "success": function (data) {
            var customizedProgram = data.programmePageModel.customizedProgramList;
            if(customizedProgram != null && customizedProgram.length > 0){
                $("#"+compId+"_list").html("");
                var html = "";
                for(var i = 0;i < customizedProgram.length; i++){
                    var productUuid = customizedProgram[i].uuid ;
                    var renderImage = customizedProgram[i].renderImage ;
                    var note = customizedProgram[i].name ;
                    var obsDesignId = customizedProgram[i].obsDesignId ;
                    var customUrl = ContextPath+ts.customLink+"?obsDesignId="+obsDesignId;
                    var purchaseUrl = ContextPath+ts.purchaseLink+"?obsDesignId="+obsDesignId;
                    html += "<li><div class='custom-img'>";
                    html += "<a href='"+purchaseUrl+"'><img src='"+renderImage+"'></a></div><div class='custom-click'>";
                    html += "<p><a href='"+purchaseUrl+"'>"+note+"</a></p><div class='custom-btn'>";
                    html += "<a class='c-btn-l' href='"+customUrl+"'>立即定制</a>";
                    html += "<a class='c-btn-r' href='"+purchaseUrl+"'>立即购买</a>";
                    html += "</div></div></li>"
                }
                $("#"+compId+"_list").html(html);
            }else{
                 $("#"+compId+"_list").html("暂无您想要的数据");
                 $("#"+compId+"_page").html("");
            }
            ts._bindEvent();
        }
    });
}

Comps.programmeDetailComp.prototype._bindEvent = function () {
    var ts = this;
    var totalPage = $("#totalPage").val();

    /*首页按钮*/
    $(".first_btn").click(function(){
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = $("#styleId").val() ;
        var areaId =$(this).attr("areaId");
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId,"nowPage":"1"};
        ts.loadData(option);
        $(".y_cur").removeClass("y_cur");
        $(".page_turn").eq(0).addClass("y_cur");
        $(".last_btn").addClass("disabled");
        $(".y_num").text(1);
    });

    /*上一页按钮*/
    $(".last_btn").click(function(){
        var nowPage = $(".y_cur").text();
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = $("#styleId").val() ;
        var areaId =$(this).attr("areaId");
        var page = nowPage-1;
        if(page <= 0){
            page = 1 ;
        }
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId,"nowPage":page};
        if(nowPage-1 == 1){
            $(".last_btn").addClass("disabled");
        }
        $(".next_btn").removeClass("disabled");
        ts.loadData(option);
        $(".y_cur").removeClass("y_cur");
        $(".page_turn").eq(page-1).addClass("y_cur");
        $(".y_num").text(page);
    });

    /*页数按钮*/
    $(".page_turn").click(function(){
        var nowPage = $(this).text();
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = $("#styleId").val() ;
        var areaId =$(this).attr("areaId");
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId,"nowPage":nowPage};
        ts.loadData(option);
        $(".y_cur").removeClass("y_cur");
        $(this).addClass("y_cur");
        if(nowPage != 1){
            $(".last_btn").removeClass("disabled");
        }
        if(nowPage == 1){
            $(".last_btn").addClass("disabled");
        }
        if(nowPage != totalPage){
             $(".next_btn").removeClass("disabled");
        }
        if(nowPage == totalPage){
            $(".next_btn").addClass("disabled");
        }
        $(".y_num").text(nowPage);
    });

    /*下一页按钮*/
    $(".next_btn").click(function(){
        var nowPage = $(".y_cur").text();
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = $("#styleId").val() ;
        var areaId =$(this).attr("areaId");
        var page = parseInt(nowPage)+parseInt(1);
        if((parseInt(nowPage)+parseInt(1)) >= totalPage){
            page = totalPage ;
        }
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId,"nowPage":page};
        if((parseInt(nowPage)+parseInt(1)) == totalPage){
            $(".next_btn").addClass("disabled");
        }
        ts.loadData(option);
        $(".y_cur").removeClass("y_cur");
        $(".page_turn").eq(page-1).addClass("y_cur");
        $(".y_num").text(page);
         $(".last_btn").removeClass("disabled");
    });

    /*尾页按钮*/
    $(".end_btn").click(function(){
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = $("#styleId").val() ;
        var areaId =$(this).attr("areaId");
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId,"nowPage":totalPage};
        ts.loadData(option);
        $(".y_cur").removeClass("y_cur");
        $(".page_turn").eq(totalPage-1).addClass("y_cur");
        $(".next_btn").addClass("disabled");
        $(".y_num").text(totalPage);
    });

    $(".y_pagenumber").mouseover(function(){
        $(this).addClass("active");
    });
    $(".y_pagenumber").mouseout(function(){
        $(this).removeClass("active");
    });

    $("ul#page_btn").on("click","li",function(){
        var page = $(this).text() ;
        var schemeType = $("#schemeType").val();
        var programTemplateUuid = $("#styleId").val() ;
        var areaId =$(this).attr("areaId");
        var option ={"schemeType":schemeType,"programTemplateUuid":programTemplateUuid,"areaId":areaId,"nowPage":page};
        ts.loadData(option);
        $(".y_num").text(page);
        $(".y_cur").removeClass("y_cur");
        $(".page_turn").eq(page-1).addClass("y_cur");
     });
}


Comps.manufacturingChannel = function (config) {
    this.compId = config.compId;
    this.config = config;
    this.channels = config.channels;
    this.needAsyncInit = config.needAsyncInit;
    this.customUrl = config.customUrl;
}

Comps.manufacturingChannel.prototype.init = function () {
    var that = this ;
	var channels = that.channels ;
	if (that.needAsyncInit) {
         $.ajax({
               type: "GET",
               url: ContextPath+"/manufacturingChannel/ajaxLoadData",
               data: {"channels":channels},
               dataType: "json",
               success: function(data){
                   console.log(data);
                   var html = "";
                   if(data != null && data.length > 0){
                        $("#"+that.compId+"_header").html("");
                        var url = "";
                        if (data[0].channelType == "1") {
                            url = that.customUrl + data[0].pageUuid;
                        } else {
                            url = data[0].channelUrl;
                        }
                        $("#"+that.compId+"_title").attr("href",url).html(data[0].channelName);
                        for(var i=0; i<data.length ;i++){
                            var channelUrl = "";
                            if (data[i].channelType == "1") {
                                if(data[i].anotherName != ""){
                                    channelUrl = that.customUrl + data[i].anotherName+".htm";
                                }else{
                                    channelUrl = that.customUrl + data[i].pageUuid;
                                }
                            } else {
                                channelUrl = data[i].channelUrl;
                            }
                            if(i == data.length-1){
                               html += "<a class='c-right-last' href='"+channelUrl+"'>"+data[i].channelName+"</a>";
                            }else{
                                html += "<a href='"+channelUrl+"'>"+data[i].channelName+"</a>";
                            }
                        }
                   }
                   $("#"+that.compId+"_header").html(html);
               }
         });
	}
    Utils.ajaxLoadComplate(that);
}

Comps.internalBulletin = function (config) {
    this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.url = config.url;
    this.magazineUuids = config.magazineUuids;
}

Comps.internalBulletin.prototype.init = function () {
    var that = this ;
    if(that.needAsyncInit){
        $.ajax({
            "url": ContextPath+"/internalBulletin/ajaxLoadData.json",
            data: {"magazineUuids": that.magazineUuids},
            "success": function (data) {
                that.render(data);
                that._bindEvent();
                Utils.ajaxLoadComplate(that);
            }
        })
    }else{
        that._bindEvent();
        Utils.ajaxLoadComplate(that);
    }

}

Comps.internalBulletin.prototype.render = function (data) {
    var that = this;
    var compId = that.compId;
    var html = "" ;
    if(data != "" && data != null){
        $("#"+compId+"_ul").html("");
        for(var i=0; i<data.length; i++){
            if(data[i] != "" && data[i] != null){
                var url = that.url + data[i].uuid;
                var imgUrl = "";
                if(data[i].imageUrl != "" && data[i].imageUrl != null ){
                    imgUrl = data[i].imageUrl ;
                }
                html += "<li class='j_magazine_li home-style-li' style='margin-right:65px;'>" ;
                html += "<a id='$_compId_a' target='_blank' href='"+url+"'>" ;
                html += "<div class='home-s-item-i'>";
                html += "<img id='$_compId_img' src='"+imgUrl+"' alt=''></div>" ;
                html += "<p class='j_magazine_title home-life-one'>"+data[i].title+"</p>";
                html += "<p class='j_magazine_note home-life-two'>"+data[i].description+"</p>";
                html += "<p class='j_magazine_time'>发布时间："+data[i].time+"</p></a></li>" ;
            }
        }
        $("#"+compId+"_ul").html(html);
    }
}

Comps.internalBulletin.prototype._bindEvent = function () {
    $('.home-life.flexslider').flexslider({
        animation:"slide",
        itemWidth:215,
        itemMargin:65
    });
}

//服务保障组件
Comps.bottompromise = function(option) {
    this.compId = option.compId;
    this.needAsyncInit = option.needAsyncInit;
    this.promiseName = option.promiseName;
    this.imgSrc = option.imgSrc;
    this.defineUrl = option.defineUrl;
}

Comps.bottompromise.prototype.init = function(){
    var that = this;
    $("#" + that.compId + "_a").attr("href",that.defineUrl);
    $("#" + that.compId + "_name").html(that.promiseName);
    Utils.ajaxLoadComplate(that);
}

Comps.informationContent = function (config) {
    this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.pictureStyle = config.pictureStyle;
    this.contentUuid = config.contentUuid;
    this.skipUrl = config.skipUrl;
    this.imgUrl = config.imgUrl;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
    this.contentTitle = config.contentTitle;
}


Comps.informationContent.prototype.init = function () {
    var that = this ;
    if(that.needAsyncInit){
        if("true" == that.pictureStyle){
            $("#"+that.compId).addClass("item_l");
        }else{
            $("#"+that.compId).addClass("m_item");
        }

        $.ajax({
            type: "GET",
            url: ContextPath + "/informationContentComp/getContentId",
            data: {
                contentUuid: that.contentUuid
            },
            dataType: "json",
            async: true,
            success: function(data) {
                if(data){
                    $("#"+that.compId+"_a1").attr("href",that.skipUrl+"/"+data+".htm");
                    $("#"+that.compId+"_a2").attr("href",that.skipUrl+"/"+data+".htm").html(that.contentTitle);
                }else{
                    $("#"+that.compId+"_a1").attr("href",that.skipUrl+"/"+that.contentUuid+".htm");
                    $("#"+that.compId+"_a2").attr("href",that.skipUrl+"/"+that.contentUuid+".htm").html(that.contentTitle);
                }

            }
        })


        $("#"+that.compId+"_img").attr("src",that.imgUrl).attr("width",that.defineWidth).attr("height",that.defineHeight);

    }else{
        Utils.ajaxLoadComplate(that);
    }
}

Comps.newInformationContent = function (config) {
    this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.content = config.content;
    this.contentUuid = config.contentUuid;
    this.skipUrl = config.skipUrl;
    this.imgUrl = config.imgUrl;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
    this.contentTitle = config.contentTitle;
}


Comps.newInformationContent.prototype.init = function () {
    var that = this ;
    if(that.needAsyncInit){

        $.ajax({
            type: "GET",
            url: ContextPath + "/informationContentComp/getContentId",
            data: {
                contentUuid: that.contentUuid
            },
            dataType: "json",
            async: true,
            success: function(data) {
                if(data){
                    $("#"+that.compId+"_a1").attr("href",that.skipUrl+"/"+data+".htm");
                    $("#"+that.compId+"_a2").attr("href",that.skipUrl+"/"+data+".htm").html(that.contentTitle);
                    $("#"+that.compId+"_a3").attr("href",that.skipUrl+"/"+data+".htm").html(decodeURI($.base64.decode(that.content)));
                }else{
                    $("#"+that.compId+"_a1").attr("href",that.skipUrl+"/"+that.contentUuid+".htm");
                    $("#"+that.compId+"_a2").attr("href",that.skipUrl+"/"+that.contentUuid+".htm").html(that.contentTitle);
                    $("#"+that.compId+"_a3").attr("href",that.skipUrl+"/"+that.contentUuid+".htm").html(decodeURI($.base64.decode(that.content)));
                }

            }
        })
        $("#"+that.compId+"_img").attr("src",that.imgUrl).attr("width",that.defineWidth).attr("height",that.defineHeight);
    }else{
        Utils.ajaxLoadComplate(that);
    }
}

Comps.newJournalism = function (config) {
    this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.pictureStyle = config.pictureStyle;
    this.layoutStyle = config.layoutStyle;
    this.content = config.content;
    this.contentUuid = config.contentUuid;
    this.skipUrl = config.skipUrl;
    this.imgUrl = config.imgUrl;
    this.defineWidth = config.defineWidth;
    this.defineHeight = config.defineHeight;
    this.contentTitle = config.contentTitle;
}


Comps.newJournalism.prototype.init = function () {
    var that = this ;
    if(that.needAsyncInit){
        if("true" == that.pictureStyle){
            $("#"+that.compId).addClass("hotnews_l");
            $("#"+that.compId+"_div").addClass("m_pic");
        }else{
             $("#"+that.compId+"_div").addClass("pic");
            if("true" == that.layoutStyle){
                $("#"+that.compId).addClass("m_hotnews");
            }else{
                $("#"+that.compId).addClass("m_bathroombox");
            }
        }
        $.ajax({
            type: "GET",
            url: ContextPath + "/informationContentComp/getContentId",
            data: {
                contentUuid: that.contentUuid
            },
            dataType: "json",
            async: true,
            success: function(data) {
                if(data){
                    $("#"+that.compId+"_a1").attr("href",that.skipUrl+"/"+data+".htm");
                    $("#"+that.compId+"_img").attr("src",that.imgUrl).attr("width",that.defineWidth).attr("height",that.defineHeight);
                    $("#"+that.compId+"_a2").attr("href",that.skipUrl+"/"+data+".htm").html(that.contentTitle);
                    $("#"+that.compId+"_a3").attr("href",that.skipUrl+"/"+data+".htm").html(decodeURI($.base64.decode(that.content)));
                }else{
                    $("#"+that.compId+"_a1").attr("href",that.skipUrl+"/"+that.contentUuid+".htm");
                    $("#"+that.compId+"_img").attr("src",that.imgUrl).attr("width",that.defineWidth).attr("height",that.defineHeight);
                    $("#"+that.compId+"_a2").attr("href",that.skipUrl+"/"+that.contentUuid+".htm").html(that.contentTitle);
                    $("#"+that.compId+"_a3").attr("href",that.skipUrl+"/"+that.contentUuid+".htm").html(decodeURI($.base64.decode(that.content)));
                }

            }
        })

    }else{
        Utils.ajaxLoadComplate(that);
    }
}

Comps.informationHeadlines = function (config) {
    this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.moreOrLess = config.moreOrLess;
    this.title = config.title;
    this.moerUrl = config.moerUrl;
    this.categoryUuid = config.categoryUuid;
}


Comps.informationHeadlines.prototype.init = function () {
    var that = this ;
    if(that.needAsyncInit){
        $("#"+that.compId+"_title").html(that.title);
        if("true" == that.moreOrLess){
            var html = "<a href='"+that.moerUrl+"?categoryUuid="+that.categoryUuid+"'>更多<b>&gt;</b></a></div>"
            $("#"+that.compId).append(html);
        }
    }else{
        Utils.ajaxLoadComplate(that);
    }
}


Comps.informationList = function(option){
	this.compId = option.compId;
	this.needAsyncInit = option.needAsyncInit;
	this.defineWidth = option.defineWidth;
	this.defineHeight = option.defineHeight;
	this.uuids = option.uuids;
	this.imgUrl = option.imgUrl;
	this.title = option.title;
}

Comps.informationList.prototype.init=function(){
	var that=this;

	if (that.needAsyncInit) {
        $.ajax({
	        type: "GET",
	        url: ContextPath + "/informationList/ajaxLoadData",
	        data: {
	            uuids: that.uuids
	        },
	        dataType: "json",
	        async: true,
	        success: function(data) {
	        	var content = $(".j_content").first();

	        	$("#"+that.compId+"_content").empty();
				$("#"+that.compId+"_title").text(that.title);
	        	if (data.length == 0) {
	        		return ;
	        	};
                $("#"+that.compId+"_a").attr("href", ContextPath + "/news/" +data[0].contentId+".htm");
                $("#"+that.compId+"_img").attr("src",that.imgUrl);
                $("#"+that.compId+"_img").attr("width",that.defineWidth);
                $("#"+that.compId+"_img").attr("height",that.defineHeight);

                if(data.length > 1){
                    for(var i=1 ; i<data.length;i++){
                        var htm = content.clone();
                        $("#"+that.compId+"_a1").attr("href", ContextPath + "/news/" +data[i].contentId+".htm").text(data[i].contentTitle);
                        $("#"+that.compId+"_content").append(htm);
                    }
                }
	        	Utils.ajaxLoadComplate(that);
	        }
	    })
	} else {
		Utils.ajaxLoadComplate(that);
	}
}

//====================================================官网首页头部开始============================================
Comps.websiteTopComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.name = config.name;
    this.websiteTabList = config.websiteTabList;
}

Comps.websiteTopComp.prototype.init = function() {
	var that =this;
	var compId = this.compId;
	if (this.needAsyncInit) {
        if (that.name) {
            $("#"+compId+"_name").html(that.name);
        } else {
            $("#"+compId+"_name").html("集团官网");
        }
        var websiteTabList = that.websiteTabList;
        if (websiteTabList != null && websiteTabList.length > 0) {
            var compEleOl = $("#"+compId+"_ol");
            var eleli = compEleOl.find(".tab_li").first();
            compEleOl.empty();
            for (var i = 0 ; i < websiteTabList.length; i++) {
                var eleliClone = eleli.clone();
                var websiteTabDTO = websiteTabList[i];
                if (websiteTabDTO.jumpUrl != '') {
                    eleliClone.find(".jumpUrl").first().attr("href",websiteTabDTO.jumpUrl).attr("target","_blank");
                }
                if (websiteTabDTO.tabName != '') {
                    eleliClone.find(".tabName").first().html(websiteTabDTO.tabName);
                }
                if (websiteTabDTO.introduce != '') {
                    eleliClone.find(".introduce").first().html(websiteTabDTO.introduce);
                }
                compEleOl.append(eleliClone);
            }
        }
	}
    Utils.ajaxLoadComplate(that);
}
//====================================================官网首页头部结束============================================

//====================================================官网首页导航开始============================================
Comps.websiteNavigation = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.logoSrc = config.logoSrc
    this.logoUrl = config.logoUrl
    this.productSearchUrl = config.productSearchUrl
    this.websiteNavigationList = config.websiteNavigationList;
}

Comps.websiteNavigation.prototype.init = function() {
	var that =this;
	var compId = this.compId;
	if (this.needAsyncInit) {
        if (that.logoUrl != '') {
            $("#"+compId+"_logo_a").attr("href",that.logoUrl).attr("target","_blank");
        } else {
            $("#"+compId+"_logo_a").attr("href","/").attr("target","_blank");
        }
        $("#"+compId+"_logo_img").attr("src",that.logoSrc);
        var websiteNavigationList = that.websiteNavigationList;
        if (websiteNavigationList != null && websiteNavigationList.length > 0) {
            var compEleUl = $("#"+compId + "_ul");
            var compEleLi = compEleUl.find(".websiteNavigationLi").first();
            compEleUl.empty();
            for (var i = 0 ; i < websiteNavigationList.length; i++) {
                var compEleLiClone = compEleLi.clone();
                var navigation = websiteNavigationList[i];
                console.log(compEleLiClone.find(".websiteNavigation_a").html());
                if (navigation.jumpUrl != '') {
                    compEleLiClone.find(".websiteNavigation_a").first().attr("href",navigation.jumpUrl).attr("target","_blank").html(navigation.name);
                }else {
                    compEleLiClone.find(".websiteNavigation_a").first().attr("href","javascript:;").html(navigation.name);
                }

                var compEleDiv = compEleLiClone.find(".second-box").first();
                compEleDiv.empty();
                var navigationSecondList = navigation.websiteNavigationSecondList;
                var navigationThreeList = navigation.websiteNavigationThreeList;
                if (navigationSecondList != null && navigationSecondList.length > 0) {
                    var html = "<div id='mask' class='visible-pc'></div><div class='jp-navdrop bg' id='navbox'>";
                    html += "<div class='g-box second-navigation'><div class='jp-navdropbox  clearfix'>";
                    for (var j = 0 ; j < navigationSecondList.length; j++) {
                        var navigationSecond = navigationSecondList[j]
                        html += "<div class='jp-item'><div class='m-pic'>";
                        html += "<a href='"+navigationSecond.secondUrl+"' target='_blank'>" +
                                "<img class='secondImg' src='"+navigationSecond.imgSrc+"'></a></div>";
                    }
                    if (navigationThreeList != null && navigationThreeList.length > 0) {
                        for (var a = 0 ; a < navigationSecondList.length; a++) {
                            var navigationThree = navigationSecondList[a];
                            html += "<p><a href='"+navigationThree.threeUrl+"' target='_blank'>"+navigationThree.threeName+"</a>";
                        }
                    }
                    html += "</div>";
                    compEleDiv.html(html);
                }
                compEleUl.append(compEleLiClone);
            }
        }
	}
	that.bindEvent1();
	that.bindEvent2();
    Utils.ajaxLoadComplate(that);
}
Comps.websiteNavigation.prototype.bindEvent1 = function() {
    var windowH = $(window).height();
	var bannerH = $('.index_banner').height();
	var bH = 0.4 * bannerH;
	$(window).scroll(function () {
		var scroTop = $(window).scrollTop() + 100;

		var jpWebsiteH = $('.jp-website-cont').height();
		// 移动端 滚动头部透明度
		var opc = 0.4;
		if(scroTop <= bannerH) {
			opc += (scroTop - 100) / bannerH;
			if(scroTop == 100) {
				opc = 0.4;
			}
		}else {
			opc = 1;
		}
		$('.jm-header-bg').css('opacity',opc);

		if($(window).scrollTop() > jpWebsiteH) {
			$('.jp-header').css({'position':'fixed','top': 0})
		}else {
			$('.jp-header').css({'position':'absolute','top': 0})
		}

		// pc 头部透明度
		if(scroTop > 500) {
			$('.jp-header').css({'backgroundColor':'rgba(255,255,255,1)'})
		}else {
			$('.jp-header').css({'backgroundColor':'rgba(255,255,255,0.5)'})
		}
	})
}


Comps.websiteNavigation.prototype.bindEvent2 = function() {
    var timer = ''
	$('.jp-drop > a').click(function(){
		if($(this).hasClass('nav-active-color')){
			clearTimeout(timer);
			$(this).removeClass('nav-active-color')
			$(this).parent('.jp-drop').find('#mask').css({"opacity":"0",'display': 'none'});
			$(this).parent('.jp-drop').find("#navbox").stop().animate({
				height:0,
				opacity:0
			},400);
			timer = setTimeout(function () {
				$(this).parent('.jp-drop').find('#navbox').hide()
			},400)
		}else{
			$(this).parent('.jp-drop').find('#navbox').show();
			var hei = $(this).parent('.jp-drop').find('#navbox .jp-navdropbox').height()
			$(this).addClass('nav-active-color')
			$(this).parent('.jp-drop').find('#mask').css({"opacity":"0.3",'display': 'block'});
			$(this).parent('.jp-drop').find("#navbox").stop().animate({
				height:hei+90,
				opacity:1
			},400);
		}
	})
	$('.jp-drop a #mask').click(function(){
		clearTimeout(timer);
		('.jp-drop a').removeClass('nav-active-color')
		$(this).parent('.jp-drop').find('#mask').css({"opacity":"0",'display': 'none'});
		$(this).parent('.jp-drop').find("#navbox").stop().animate({
			height:0,
			opacity:0
		},400);
		timer = setTimeout(function () {
			$(this).parent('.jp-drop').find('#navbox').hide()
		},400)
	})
}
//====================================================官网首页导航结束============================================

//====================================================官网首页分类开始============================================
Comps.websiteCategory = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.categoryList = config.categoryList;
}

Comps.websiteCategory.prototype.init = function() {
	var that =this;
	var compId = that.compId;
	if (this.needAsyncInit) {
	    var compEleOl = $("#"+compId+"_ol");
	    var compEleLi = compEleOl.find(".websiteCategory_li").first();
	    compEleOl.empty();

	    var compEleMobileOl = $("#"+compId+"_mobile_ol");
        var compEleMobileLi = compEleMobileOl.find(".websiteCategory_mobile_li").first();
        compEleMobileOl.empty();


	    var categoryList = that.categoryList;
        if (categoryList != null && categoryList.length > 0) {
            for (var i = 0 ; i < categoryList.length ; i++) {
                var category = categoryList[i];
                var compEleLiClone = compEleLi.clone();
                if (category.imgSrc != '') {
                    compEleLiClone.find(".websiteCategory_img").first().attr("src",category.imgSrc);
                }
                if (category.jumpUrl != '') {
                    compEleLiClone.find(".websiteCategory_a").first().attr("href",category.jumpUrl).attr("target","_blank");
                } else {
                    compEleLiClone.find(".websiteCategory_a").first().attr("href","/").attr("target","_blank");
                }
                if (category.name != '') {
                    compEleLiClone.find(".websiteCategory_name").first().html(category.name);
                }
                compEleOl.append(compEleLiClone);

                 var compEleMobileLiClone = compEleMobileLi.clone();
                 if (category.imgSrc != '') {
                     compEleMobileLiClone.find(".websiteCategory_mobile_img").first().attr("src",category.imgSrc);
                 }
                 if (category.mobileUrl != '') {
                     compEleMobileLiClone.find(".websiteCategory_mobile_a").first().attr("href",category.mobileUrl).attr("target","_blank");
                 } else {
                     compEleMobileLiClone.find(".websiteCategory_mobile_a").first().attr("href","/").attr("target","_blank");
                 }
                 if (category.name != '') {
                     compEleMobileLiClone.find(".websiteCategory_mobile_name").first().html(category.name);
                 }
            }
        }
	}
    Utils.ajaxLoadComplate(that);
}
//====================================================官网首页分类结束============================================


//====================================================官网首页热门商品开始============================================
Comps.websiteStarProduct = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.moreUrl = config.moreUrl;
    this.websiteStarProductList = config.websiteStarProductList;
}

Comps.websiteStarProduct.prototype.init = function() {
	var that =this;
	var compId = that.compId;
	if (this.needAsyncInit) {
        var websiteStarProductList = that.websiteStarProductList;
        if (websiteStarProductList != '' && websiteStarProductList.length > 0) {
            var starProduct = websiteStarProductList[0];
            if (starProduct.bigImgSrc != '') {
                $("#"+compId+"_bigImg").attr("src",starProduct.bigImgSrc);
            }
            if (starProduct.jumpUrl != '') {
                $("#"+compId+"_a").attr("href",starProduct.jumpUrl).attr("target","_blank");
            } else {
                $("#"+compId+"_a").attr("href","/").attr("target","_blank");
            }
            var compEleDiv = $("#"+compId+"_div");
            var compEleDiv2 = compEleDiv.find(".websiteStarProduct_div").first();
            compEleDiv.empty();
            for (var i = 0 ; i < websiteStarProductList.length ;i++){
                var starProduct1 = websiteStarProductList[i];
                var compEleDivClone = compEleDiv2.clone();
                if (starProduct1.bigImgSrc != '') {
                    compEleDivClone.attr("data-img",starProduct1.bigImgSrc);
                }
                if (starProduct1.jumpUrl != '') {
                    compEleDivClone.attr("data-a",starProduct1.jumpUrl);
                } else {
                   compEleDivClone.attr("data-a","/");
                }
                if (starProduct1.imgSrc != '') {
                    compEleDivClone.find(".websiteStarProduct_img").attr("src",starProduct1.imgSrc);
                }
                compEleDiv.append(compEleDivClone);
            }
            if (that.moreUrl != '') {
                $("#"+compId+"_moreUrl").attr("href",that.moreUrl).attr("target","_blank");
            }
        }
	}
	that.bindEvent();
    Utils.ajaxLoadComplate(that);
}

Comps.websiteStarProduct.prototype.bindEvent=function(){
    $('.jp-slide').bxSlider({
        mode: 'vertical',
        slideWidth: 84,
        minSlides: 4,
        slideMargin: 30
    });

    $('.jp-slide .slide').hover(function () {
        var imgUrl = $(this).attr('data-img');
        var jumpUrl = $(this).attr('data-a');
        $('.jp-slide-img img').attr('src',imgUrl);
        $('.jp-slide-img a').attr('href',jumpUrl).attr("target","_blank");
    })

    // 滚动动画
    setTimeout(function () {
        AOS.init({
            disable: function () {
                var maxWidth = 992;
                return window.innerWidth < maxWidth;
            },
        });
    },100);
}


//====================================================官网首页热门商品结束============================================



//====================================================官网首页商品展示开始============================================
Comps.websiteProduct = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.websiteProductList = config.websiteProductList;
}

Comps.websiteProduct.prototype.init = function() {
	var that =this;
	var compId = that.compId;
	if (this.needAsyncInit) {
        var compEleDiv = $("#"+compId+"_div");
        var compEleDiv2 = compEleDiv.find(".websiteProduct_div").first();
        compEleDiv.empty();
        var websiteProductList = that.websiteProductList;
        if(websiteProductList != null && websiteProductList.length > 0){
            for (var i = 0; i < websiteProductList.length; i++) {
                var websiteProduct = websiteProductList[i];
                var compEleDivClone = compEleDiv2.clone();
                if (websiteProduct.imgSrc != '') {
                    compEleDivClone.find(".websiteProduct_img").first().attr("src",websiteProduct.imgSrc);
                }
                if (websiteProduct.jumpUrl != '') {
                    compEleDivClone.find(".websiteProduct_a").first().attr("href",websiteProduct.jumpUrl).attr("target","_blank");
                } else {
                    compEleDivClone.find(".websiteProduct_a").first().attr("href","/").attr("target","_blank");
                }
                if (websiteProduct.name != '') {
                    compEleDivClone.find(".websiteProduct_name").first().html(websiteProduct.name);
                }
                if (websiteProduct.introduce != '') {
                    compEleDivClone.find(".websiteProduct_introduce").first().html(websiteProduct.introduce);
                }
                compEleDiv.append(compEleDivClone);
            }
        }
	}
	that.bindEvent();
    Utils.ajaxLoadComplate(that);
}
Comps.websiteProduct.prototype.bindEvent=function(){
    var swiper = new Swiper('.jp-slide-bottom .swiper-container', {
        slidesPerView: 3,
        nextButton: '.swiper-button-next3',
        prevButton: '.swiper-button-prev3',
    });
}
//====================================================官网首页商品展示结束============================================

//====================================================官网首页精品套装开始============================================
Comps.boutiqueSuite = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.boutiqueSuiteList = config.boutiqueSuiteList;
}

Comps.boutiqueSuite.prototype.init = function() {
	var that =this;
	var compId = that.compId;
	if (this.needAsyncInit) {
        var compEleDiv = $("#"+compId+"_div");
        var compEleMobileDiv = $("#"+compId+"_mobile_div");
        var compEleDiv2 = compEleDiv.find(".boutiqueSuite_div").first();
        var compEleMobileDiv2 = compEleMobileDiv.find(".boutiqueSuite_mobile_div").first();
        compEleDiv.empty();
        compEleMobileDiv.empty();
        var boutiqueSuiteList = that.boutiqueSuiteList;
        if (boutiqueSuiteList != null && boutiqueSuiteList.length > 0) {
            for (var i = 0 ; i < boutiqueSuiteList.length; i++) {
                var boutiqueSuite = boutiqueSuiteList[i];
                var compEleDivClone = compEleDiv2.clone();
                if (boutiqueSuite.imgSrc != '') {
                    compEleDivClone.find(".boutiqueSuite_img").first().attr("src",boutiqueSuite.imgSrc);
                }
                if (boutiqueSuite.jumpUrl != '') {
                    compEleDivClone.find(".boutiqueSuite_a").first().attr("href",boutiqueSuite.jumpUrl).attr("target","_blank");
                }
                compEleDiv.append(compEleDivClone);

                var compEleMobileDivClone = compEleMobileDiv2.clone();
                if (boutiqueSuite.imgSrc != '') {
                    compEleMobileDivClone.find(".boutiqueSuite_mobile_img").first().attr("src",boutiqueSuite.imgSrc);
                }
                if (boutiqueSuite.jumpUrl != '') {
                    compEleMobileDivClone.find(".boutiqueSuite_mobile_a").first().attr("href",boutiqueSuite.jumpUrl).attr("target","_blank");
                }
                compEleMobileDiv.append(compEleMobileDivClone);
            }
        }

	}
	that.bindEvent();
    Utils.ajaxLoadComplate(that);
}

Comps.boutiqueSuite.prototype.bindEvent=function(){
    var windW = $(window).width();
    if(windW > 992) {
        $('.swiper-cont .swiper-slide').width(windW * 0.28);

         new Swiper('.swiper-cont', {
            effect: 'coverflow',
            grabCursor: true,
            centeredSlides: true,
            slidesPerView: 'auto',
            loop : true,
            initialSlide: 2,
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',
            coverflow: {
                rotate: 0,
                stretch: 0,
                depth: 194,
                modifier: 2,
                slideShadows : true
            }
        });
    }else {
        // 移动端
        new Swiper('.jm-swiper', {
            paginationClickable: true,
            slidesPerView: 2.4,
            spaceBetween: 8,
        });
    }
}

//====================================================官网首页精品套装结束============================================


//====================================================官网标题组件开始============================================
Comps.websiteTitle = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.title = config.title;
    this.englishTitle = config.englishTitle;
}

Comps.websiteTitle.prototype.init = function() {
	var that =this;
	var compId = this.compId;
	if (this.needAsyncInit) {
        $("#"+compId+"_title").html(that.title);
        $("#"+compId+"_english_title").html(that.englishTitle);
        $("#"+compId+"_mobile_title").html(that.title);
	}
    Utils.ajaxLoadComplate(that);
}
//====================================================官网标题组件结束============================================

//====================================================官网资讯开始============================================
Comps.websiteInformation = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.moreUrl = config.moreUrl;
    this.detailsUrl = config.detailsUrl;
    this.imgSrc = config.imgSrc;
    this.videoUuid = config.videoUuid;
    this.videoName = config.videoName;
    this.videoUrl = config.videoUrl;
    this.websiteInformationList = config.websiteInformationList;
}

Comps.websiteInformation.prototype.init = function() {
	var that =this;
	var compId = this.compId;
	if (this.needAsyncInit) {
        if (that.imgSrc != '') {
            $("#"+compId+"_video").attr("poster",that.imgSrc);
        }
        $("#"+compId+"_video").attr("src",that.videoUrl);
        var compEleUl = $("#"+compId+"_ul");
        var compEleli = compEleUl.find(".websiteInformation_li").first();
        compEleUl.empty();
        var websiteInformationList = that.websiteInformationList;
        if (websiteInformationList != '' && websiteInformationList.length >0) {
            for (var i = 0 ; i < websiteInformationList.length ; i++) {
                var compEleliClone = compEleli.clone();
                var information = websiteInformationList[i];

                $.ajax({
                    type: "GET",
                    url: ContextPath + "/websiteInformation/ajaxLoadData",
                    data: {
                        contentUuid: information.contentUuid
                    },
                    dataType: "json",
                    async: true,
                    success: function(data) {
                        if (information.contentName != '') {
                            compEleliClone.find(".websiteInformation_a").first().html(information.contentName)
                                .attr("href",that.detailsUrl+data.contentId+".htm").attr("target","_blank");
                        }else {
                            compEleliClone.find(".websiteInformation_a").first().html(data.contentTitle)
                                .attr("href",that.detailsUrl+data.contentId+".htm").attr("target","_blank");
                        }
                        if (information.introduction != '') {
                            compEleliClone.find(".websiteInformation_a2").first().html(information.introduction)
                                .attr("href",that.detailsUrl+data.contentId+".htm").attr("target","_blank");
                        }
                    }
                })
                compEleUl.append(compEleliClone);
            }
        }
        if(that.moreUrl != ''){
            $("#"+compId+"_more").attr("href",that.moreUrl).attr("target","_blank");
        }
	}
	that.bindEvent();
    Utils.ajaxLoadComplate(that);
}
Comps.websiteInformation.prototype.bindEvent=function(){
    // 点击视频播放
    $(".v-gallery-play").on("click",function(){
        var videoDom = document.querySelector(".information-video").play();
        $(".v-gallery-play").css("display","none");
    })
}
//====================================================官网资讯开始============================================

//====================================================官网底部开始============================================
Comps.websiteBottom = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
}

Comps.websiteBottom.prototype.init = function() {
    var that = this;
    var compId = this.compId;
    if (this.needAsyncInit) {
        Utils.ajaxLoadComplate(that);
    }
    Utils.ajaxLoadComplate(that);
    $("#" + compId + "_a2").attr("href", "https://www.wjx.cn/jq/44916643.aspx");
}
//====================================================官网底部结束============================================


//====================================================官网品牌导航组件开始============================================
Comps.brandTop = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.brandTopLit = config.brandTopLit;
}

Comps.brandTop.prototype.init = function() {
	var that =this;
	var compId = this.compId;
	if (this.needAsyncInit) {
       var compEleUl = $("#"+compId+"_ol");
       var compEleLi = compEleUl.find(".brandTop_li").first();
       compEleUl.empty();
        var brandTopLit = that.brandTopLit;
        if (brandTopLit != null && brandTopLit.length > 0) {
            for (var i = 0 ; i < brandTopLit.length; i++) {
                var compEleLiClone = compEleLi.clone();
                var brandTop = brandTopLit[i];
                if (brandTop.jumpUrl != '') {
                    compEleLiClone.find(".brandTop_li_a").first().attr("href",brandTop.jumpUrl).attr("target","_blank").html(brandTop.name);
                } else {
                    compEleLiClone.find(".brandTop_li_a").first().attr("href","/").attr("target","_blank").html(brandTop.name);
                }
                compEleUl.append(compEleLiClone);
            }
        }
	}
    Utils.ajaxLoadComplate(that);
}
//====================================================官网品牌导航组件结束============================================


//====================================================官网荣誉页面组件开始============================================
Comps.honorComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.moreUrl = config.moreUrl;
    this.honorList = config.honorList;
    if (this.honorList != null && this.honorList.length > 0) {
        //对list进行排序
        this.honorList.sort(function (a, b) {
            return a.sequence - b.sequence;
        });
    }
}

Comps.honorComp.prototype.init = function() {
	var that =this;
	var compId = this.compId;
	if (this.needAsyncInit) {
	    var honorList = that.honorList;
        var compEleDiv = $("#" + compId + "_div");
        var compEleDiv1 = compEleDiv.find(".honor_div").first();
        compEleDiv.empty();
	    if (honorList != null && honorList.length > 0) {
	        /*//对list进行排序
	        honorList.sort(function(a,b){
                return a.sequence-b.sequence;
            });*/
            var honor = honorList[0];
            $("#currentImg").attr("src",honor.imgSrc);
            $("#"+compId + "_name").html(honor.name);
            $("#"+compId + "_winTime").html(honor.winTime);
            $("#"+compId + "_winYear").html(honor.winYear);

            for (var i = 0 ; i < honorList.length ; i++) {
                var honorDTO = honorList[i];
                 var compEleDivClone = compEleDiv1.clone();
                 compEleDivClone.find(".honor_img").attr("src",honorDTO.imgSrc).attr("data-index",i);
                 compEleDiv.append(compEleDivClone);
            }
	    }
        if (that.moreUrl != '') {
            $("#"+compId+"_moreUrl").attr("href",that.moreUrl).attr("target","_blank");
        } else {
            $("#"+compId+"_moreUrl").attr("href","/").attr("target","_blank");
        }
	}
	that.bindEvent();
    Utils.ajaxLoadComplate(that);
}

Comps.honorComp.prototype.bindEvent = function() {
    var compId = this.compId;
    var honorList = this.honorList;

    if($(window).width() < 992) {
        new Swiper('.honor-swiper', {
            slidesPerView: 1.6,
            initialSlide :1,
            loop: true,
            centeredSlides: true,
            pagination: {
                clickable: true,
            },
            onSlideChangeEnd: function(swiper){
                var currentImg = $('.swiper-slide-active').find('img').attr('src');
                var x = $('.swiper-slide-active').find('img').attr('data-index');
                var honor = honorList[x];
                $("#"+compId + "_name").html(honor.name);
                $("#"+compId + "_winTime").html(honor.winTime);
                $("#"+compId + "_winYear").html(honor.winYear);
                $('#currentImg').attr('src',currentImg);
            },
        });
    }else {
        new Swiper('.honor-swiper', {
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',
            slidesPerView: 5,
            paginationClickable: true,
            spaceBetween: 30,
            loop : true,
            swipeHandler : '.swipe-handler',
            onSlideChangeEnd: function(swiper){
                var currentImg = $('.swiper-slide-active').find('img').attr('src');
                var x = $('.swiper-slide-active').find('img').attr('data-index');
                var honor = honorList[x];
                $("#"+compId + "_name").html(honor.name);
                $("#"+compId + "_winTime").html(honor.winTime);
                $("#"+compId + "_winYear").html(honor.winYear);
                $('#currentImg').attr('src',currentImg);
            },
        });
    }
}
//====================================================官网荣誉页面组件结束============================================


//====================================================官网首页导航2开始============================================
Comps.websiteNavigation2 = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.logoSrc = config.logoSrc
    this.logoUrl = config.logoUrl
    this.productSearchUrl = config.productSearchUrl
    this.websiteNavigationList = config.websiteNavigationList;
}

Comps.websiteNavigation2.prototype.init = function() {
	var that =this;
	var compId = this.compId;
	if (this.needAsyncInit) {
        if (that.logoUrl != '') {
            $("#"+compId+"_logo_a").attr("href",that.logoUrl).attr("target","_blank");
        } else {
            $("#"+compId+"_logo_a").attr("href","/").attr("target","_blank");
        }
        $("#"+compId+"_logo_img").attr("src",that.logoSrc);
        var websiteNavigationList = that.websiteNavigationList;
        if (websiteNavigationList != null && websiteNavigationList.length > 0) {
            var compEleUl = $("#"+compId + "_ul");
            var compEleLi = compEleUl.find(".websiteNavigationLi").first();
            compEleUl.empty();
            for (var i = 0 ; i < websiteNavigationList.length; i++) {
                var compEleLiClone = compEleLi.clone();
                var navigation = websiteNavigationList[i];
                console.log(compEleLiClone.find(".websiteNavigation_a").html());
                if (navigation.jumpUrl != '') {
                    compEleLiClone.find(".websiteNavigation_a").first().attr("href",navigation.jumpUrl).attr("target","_blank").html(navigation.name);
                }else {
                    compEleLiClone.find(".websiteNavigation_a").first().attr("href","javascript:;").html(navigation.name);
                }

                var compEleDiv = compEleLiClone.find(".second-box").first();
                compEleDiv.empty();
                var navigationSecondList = navigation.websiteNavigationSecondList;
                var navigationThreeList = navigation.websiteNavigationThreeList;
                if (navigationSecondList != null && navigationSecondList.length > 0) {
                    var html = "<div id='mask' class='visible-pc'></div><div class='jp-navdrop bg' id='navbox'>";
                    html += "<div class='g-box second-navigation'><div class='jp-navdropbox  clearfix'>";
                    for (var j = 0 ; j < navigationSecondList.length; j++) {
                        var navigationSecond = navigationSecondList[j]
                        html += "<div class='jp-item'><div class='m-pic'>";
                        html += "<a href='"+navigationSecond.secondUrl+"' target='_blank'>" +
                                "<img class='secondImg' src='"+navigationSecond.imgSrc+"'></a></div>";
                    }
                    if (navigationThreeList != null && navigationThreeList.length > 0) {
                        for (var a = 0 ; a < navigationSecondList.length; a++) {
                            var navigationThree = navigationSecondList[a];
                            html += "<p><a href='"+navigationThree.threeUrl+"' target='_blank'>"+navigationThree.threeName+"</a>";
                        }
                    }
                    html += "</div>";
                    compEleDiv.html(html);
                }
                compEleUl.append(compEleLiClone);
            }
        }
	}
	that.bindEvent1();
	that.bindEvent2();
    Utils.ajaxLoadComplate(that);
}
Comps.websiteNavigation2.prototype.bindEvent1 = function() {
    var windowH = $(window).height();

    var bannerH = $('.index_banner').height();
    var bH = 0.4 * bannerH;

    //	二级头部滚动
    var scrollAction = {y: 'undefined'}, scrollDirection;
    function scrollFunc() {
        if (typeof scrollAction.y == 'undefined') {
            scrollAction.y = window.pageYOffset;
        }

        var diffY = scrollAction.y - window.pageYOffset;
        if (diffY < 0) {
            scrollDirection = 'down';
        } else if (diffY > 0) {
            scrollDirection = 'up';
        } else {
            // First scroll event
        }
        scrollAction.y = window.pageYOffset;
    }

    $(window).scroll(function () {
        var scroTop = $(window).scrollTop() + 100;
        if(scroTop > 767) {
            $('.m_backtop').show()
        }else {
            $('.m_backtop').hide()
        }
        // 移动端 滚动头部透明度
        var opc = 0.4;
        if(scroTop <= bannerH) {
            opc += (scroTop - 100) / bannerH;
            if(scroTop == 100) {
                opc = 0.4;
            }
        }else {
            opc = 1;
        }
        $('.jm-header-bg').css('opacity',opc);

        if($('.jp-website-cont').length > 0) {
            var jpWebsiteH = $('.jp-website-cont').height();
            if($(window).scrollTop() > jpWebsiteH) {
                $('.jp-header').css({'position':'fixed','top': 0})
            }else {
                $('.jp-header').css({'position':'absolute','top': 0})
            }
        }


        // pc 头部透明度
        if(scroTop > 500) {
            $('.jp-header').css({'backgroundColor':'rgba(255,255,255,1)'})
        }else {
            $('.jp-header').css({'backgroundColor':'rgba(255,255,255,0.5)'})
        }


        if($(window).width() > 992 && $('.jp-secondhead-height').length > 0) {
            $('.jp-header').css('position','absolute');
            $('.jp-second-header').addClass('secondabsolute');
            //监听页面滚动事件
            scrollFunc();
            if(scrollDirection == 'down'){
                if(scrollAction.y > 80) {
                    $('.jp-second-header').addClass('secondfixed-top');
                }else {
                     $('.jp-second-header').addClass('secondabsolute');
                }
            }
            else if(scrollDirection == 'up'){
                $('.jp-header').css({'position':'fixed',});
                $('.jp-second-header').removeClass('secondfixed-top secondabsolute');
            }
        }
    })

}


Comps.websiteNavigation2.prototype.bindEvent2 = function() {
    var timer = ''
	$('.jp-drop > a').click(function(){
		if($(this).hasClass('nav-active-color')){
			clearTimeout(timer);
			$(this).removeClass('nav-active-color')
			$(this).parent('.jp-drop').find('#mask').css({"opacity":"0",'display': 'none'});
			$(this).parent('.jp-drop').find("#navbox").stop().animate({
				height:0,
				opacity:0
			},400);
			timer = setTimeout(function () {
				$(this).parent('.jp-drop').find('#navbox').hide()
			},400)
		}else{
			$(this).parent('.jp-drop').find('#navbox').show();
			var hei = $(this).parent('.jp-drop').find('#navbox .jp-navdropbox').height()
			$(this).addClass('nav-active-color')
			$(this).parent('.jp-drop').find('#mask').css({"opacity":"0.3",'display': 'block'});
			$(this).parent('.jp-drop').find("#navbox").stop().animate({
				height:hei+90,
				opacity:1
			},400);
		}
	})
	$('.jp-drop a #mask').click(function(){
		clearTimeout(timer);
		('.jp-drop a').removeClass('nav-active-color')
		$(this).parent('.jp-drop').find('#mask').css({"opacity":"0",'display': 'none'});
		$(this).parent('.jp-drop').find("#navbox").stop().animate({
			height:0,
			opacity:0
		},400);
		timer = setTimeout(function () {
			$(this).parent('.jp-drop').find('#navbox').hide()
		},400)
	})
}
//====================================================官网首页导航2结束============================================

//====================================================官网视频组件开始============================================
Comps.websiteVideo = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.imgSrc = config.imgSrc;
    this.videoUrl = config.videoUrl;
}

Comps.websiteVideo.prototype.init = function() {
	var that =this;
	$('.z-gallery-play').click(function () {
        var videoDom = document.querySelector("#bannerVideo").play();
        $(".z-gallery-play").css("display","none");
    })
    document.querySelector("#bannerVideo").addEventListener('play',function(){
    $(".z-gallery-play").css("display","none");
    });
    Utils.ajaxLoadComplate(that);
}
//====================================================官网视频组件开始============================================

//====================================================官网视频列表组件开始============================================
Comps.websiteVideoList = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.videoList = config.videoList;
}

Comps.websiteVideoList.prototype.init = function() {
	var that = this;
	var compId = this.compId;
	var videoList = that.videoList;
    if (this.needAsyncInit) {
        var compEleUl = $("#" + compId + "_ul");
        var compEleLi = compEleUl.find(".websiteVideo_li").first();
        compEleUl.empty();
        if (videoList != null && videoList.length > 0) {
            for (var i = 0 ; i < videoList.length ; i++) {
                var websiteVideoList  =  videoList[i];
                var compEleLiClone = compEleLi.clone();
                if (i == 0) {
                    compEleLiClone.addClass("active");
                }
                compEleLiClone.html(websiteVideoList.name).attr("data-index",i);
                compEleUl.append(compEleLiClone);
            }

            var websiteVideoList  =  videoList[0];
            var websiteVideo = websiteVideoList.websiteVideoList;

            var compEleDiv = $("#"+compId+"_div");
            var compEleDiv2 = compEleDiv.find(".video_div").first();
            compEleDiv.empty();

            if (websiteVideo != null && websiteVideo.length > 0) {
                for (var j = 0 ; j < websiteVideo.length ; j++) {
                    var video = websiteVideo[j];
                    var compEleDivClone = compEleDiv2.clone();
                    if (video.imgSrc != '') {
                        compEleDivClone.find(".video-images").first().attr("src",video.imgSrc);
                    }
                    if (video.videoName != '') {
                        compEleDivClone.find(".video-name").first().html(video.videoName);
                    }
                    compEleDivClone.find(".z-video").first().attr("data-url",video.videoUrl);
                    compEleDiv.append(compEleDivClone);
                }
            }
            if (websiteVideo.length > 6) {
                $(".z-look").first().removeClass("z-hidden");
            }
        }
    }
    that.bindEvent();
    that.bindEvent2();
    Utils.ajaxLoadComplate(that);
}

Comps.websiteVideoList.prototype.bindEvent = function() {
    var that = this;
   	var compId = this.compId;
   	var videoList = that.videoList;
    $('.news-tab li').click(function(){
        var falg = $(this).hasClass("active");
        $(this).addClass('active').siblings().removeClass('active');
        var index = $(this).attr("data-index");
        if (!falg) {
            var websiteVideoList  =  videoList[index];
            var websiteVideo = websiteVideoList.websiteVideoList;

            var compEleDiv = $("#"+compId+"_div");
            var compEleDiv2 = compEleDiv.find(".video_div").first();
            compEleDiv.empty();

            if (websiteVideo != null && websiteVideo.length > 0) {
                for (var j = 0 ; j < websiteVideo.length ; j++) {
                    var video = websiteVideo[j];
                    var compEleDivClone = compEleDiv2.clone();
                    if (video.imgSrc != '') {
                        compEleDivClone.find(".video-images").first().attr("src",video.imgSrc);
                    }
                    if (video.videoName != '') {
                        compEleDivClone.find(".video-name").first().html(video.videoName);
                    }
                    compEleDivClone.find(".z-video").first().attr("data-url",video.videoUrl);
                    compEleDiv.append(compEleDivClone);
                }
            }
            if (websiteVideo.length > 6) {
                $(".z-look").first().removeClass("z-hidden");
            }
        }
    })
}

Comps.websiteVideoList.prototype.bindEvent2 = function() {
    // 查看更多
    $('.z-look .z-more ').click(function () {
        $('.mian-video').css('maxHeight','none');
        $(this).hide();
    })

    var windowW = $(window).width();
		$(document).on('click','.z-video',function () {
			var urls = $(this).attr('data-url');
			$('.video-modal').addClass('in');
			$('.video-modal video').attr('src', urls);
			$('body').addClass('modal-opened');
		})

		if(windowW <= 992) {
		    var videoH = $('.z-video').height();
            $('.mian-video').css('max-height',(videoH + 30) * 5)
			$('.video-modal-mask').click(function () {
				$('.video-modal video').get(0).pause();
				$('.video-modal').removeClass('in');
				$('.video-modal video').attr('src', '');
				$('body').removeClass('modal-open')
			})
		}

		$('.video-modal-close').click(function () {
			$('.video-modal').removeClass('in');
			$('.video-modal video').attr('src', '');
			$('body').removeClass('modal-opened')
		})
}

//====================================================官网视频列表组件开始============================================


//====================================================官网图片广告开始============================================
Comps.websitePictureAd = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.imgSrc = config.imgSrc;
    this.jumpUrl = config.jumpUrl;
    this.bigImg = config.bigImg;
    this.title = config.title;

}

Comps.websitePictureAd.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {
        $("#"+compId+"_div").empty();
        if ("0" == that.bigImg) {
            var compEleDiv = $("#"+compId+"_banner_div");
            var compEleDivClone = compEleDiv.clone();
            if(that.jumpUrl != ''){
                compEleDivClone.find("#"+compId+"_a").first().attr("href",that.jumpUrl).attr("target","_blank");
            } else {
                compEleDivClone.find("#"+compId+"_a").first().attr("href","/").attr("target","_blank");
            }
            compEleDivClone.find("#"+compId+"_img").attr("src",that.imgSrc);
            $("#"+compId+"_div").append(compEleDivClone)
        } else if ("1" == that.bigImg){
            var compEleDiv = $("#"+compId+"_img_div");
            var compEleDivClone = compEleDiv.clone();
            if (that.title != '') {
                compEleDivClone.find("#"+compId+"_img_title_div").html(that.title);
            }
            if(that.jumpUrl != ''){
                compEleDivClone.find("#"+compId+"_img_a").first().attr("href",that.jumpUrl).attr("target","_blank");
            } else {
                compEleDivClone.find("#"+compId+"_img_a").first().attr("href","/").attr("target","_blank");
            }
            compEleDivClone.find("#"+compId+"_img2").attr("src",that.imgSrc);
            $("#"+compId+"_div").append(compEleDivClone)

        }else if ("2" == that.bigImg){
            var compEleDiv = $("#"+compId+"_work_banner_div");
            var compEleDivClone = compEleDiv.clone();
            if(that.jumpUrl != ''){
                compEleDivClone.find("#"+compId+"_work_banner_a").first().attr("href",that.jumpUrl).attr("target","_blank");
            } else {
                compEleDivClone.find("#"+compId+"_work_banner_a").first().attr("href","/").attr("target","_blank");
            }
            compEleDivClone.find("#"+compId+"_work_banner_img").attr("src",that.imgSrc);
            $("#"+compId+"_div").append(compEleDivClone)
        }
    }
    Utils.ajaxLoadComplate(that);
}
//====================================================官网图片广告结束============================================


//====================================================商业服务开始============================================
Comps.businessService = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.businessServiceList = config.businessServiceList;
}

Comps.businessService.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {
        var compEleDiv = $("#"+compId+"_div");
        var compEleDiv2 = compEleDiv.find(".businessService_div").first();
        compEleDiv.empty();

        var businessServiceList = that.businessServiceList;
        if (businessServiceList != '' && businessServiceList != null && businessServiceList.length > 0) {
            for (var i = 0 ; i < businessServiceList.length ; i++) {
                var businessService = businessServiceList[i];
                var compEleDivClone = compEleDiv2.clone();
                if (businessService.jumpUrl != '') {
                    compEleDivClone.find(".businessService_a").first().attr("href",businessService.jumpUrl)
                            .attr("target","_blank");
                    compEleDivClone.find(".businessService_jumpUrl").first().attr("href",businessService.jumpUrl)
                            .attr("target","_blank");
                } else {
                    compEleDivClone.find(".businessService_a").first().attr("href","javascript:;")
                            .attr("target","_blank").addClass("m-l-hide");
                    compEleDivClone.find(".businessService_jumpUrl").first().attr("href","javascript:;")
                            .attr("target","_blank").addClass("m-l-hide");
                }
                if (businessService.imgSrc != '') {
                    compEleDivClone.find(".businessService_img").first().attr("src",businessService.imgSrc);
                }
                if (businessService.name != '') {
                    compEleDivClone.find(".businessService_name").first().html(businessService.name);
                }
                if (businessService.remark != '') {
                    compEleDivClone.find(".businessService_remark").first().html(businessService.remark);
                }
                if (businessService.mobile != '') {
                    compEleDivClone.find(".businessService_mobile").first().html(businessService.mobile);
                }
                compEleDiv.append(compEleDivClone);
            }
        }

    }
}
//====================================================商业服务结束============================================


//====================================================商业解决方案开始============================================
Comps.websiteSolution = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.websiteSolutionList = config.websiteSolutionList;
}

Comps.websiteSolution.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {
        var compEleDiv = $("#"+compId+"_div");
        var compEleDiv2 = compEleDiv.find(".websiteSolution_div").first();
        compEleDiv.empty();

        var websiteSolutionList = that.websiteSolutionList;
        if (websiteSolutionList != '' && websiteSolutionList != null && websiteSolutionList.length > 0) {
            for (var i = 0 ; i < websiteSolutionList.length ; i++) {
                var websiteSolution = websiteSolutionList[i];
                var compEleDivClone = compEleDiv2.clone();
                if (websiteSolution.jumpUrl != '') {
                    compEleDivClone.find(".websiteSolution_jumpUrl").first().attr("href",websiteSolution.jumpUrl)
                            .attr("target","_blank");
                } else {
                    compEleDivClone.find(".websiteSolution_jumpUrl").first().attr("href","/")
                            .attr("target","_blank");
                }
                if (websiteSolution.imgSrc != '') {
                    compEleDivClone.find(".websiteSolution_img").first().attr("src",websiteSolution.imgSrc);
                }
                if (websiteSolution.name != '') {
                    compEleDivClone.find(".websiteSolution_name").first().html(websiteSolution.name);
                } else {
                    compEleDivClone.find(".websiteSolution_name").first().html(websiteSolution.solutionName);
                }
                compEleDiv.append(compEleDivClone);
            }
        }

    }
}
//====================================================商业解决方案结束============================================


//====================================================展望未来开始============================================
Comps.historyComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.historyList = config.historyList;
}

Comps.historyComp.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {

        var compEleOl = $("#"+compId+"_ol");
        var compEleLi1 = compEleOl.find("#"+compId+"_head").first().clone();
        var compEleLi2 = compEleOl.find("#"+compId+"_head2").first();
        compEleOl.empty();
        compEleOl.append(compEleLi1);

        var historyList = that.historyList;
        if (historyList != null && historyList.length > 0) {
            for (var i = 0 ; i < historyList.length ; i++) {
                var compEleClone = compEleLi2.clone();
                var history = historyList[i];
                if (history.year != '') {
                    compEleClone.find(".j_years").first().html(history.year);
                }
                if (history.imgSrc != '') {
                    compEleClone.find(".j_img").first().attr("src",history.imgSrc);
                }
                if (history.describe != '') {
                    compEleClone.find(".j_describe").first().html(history.describe);
                }
                compEleOl.append(compEleClone);
            }
        }

    }
    that.bindEvent();
    Utils.ajaxLoadComplate(that);
}

Comps.historyComp.prototype.bindEvent = function() {
    AOS.init({
        disable: function () {
            var maxWidth = 992;
            return window.innerWidth < maxWidth;
        },
    });

}
//====================================================展望未来结束============================================

Comps.homeTitle = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.title = config.title;
    this.remark = config.remark;
}

Comps.homeTitle.prototype.init = function() {
	var that =this;
	var compId = this.compId;
	if (this.needAsyncInit) {
        $("#"+compId+"_h3").html(that.title);
        $("#"+compId+"_p").html(that.remark);
	}
    Utils.ajaxLoadComplate(that);
}

//====================================================家在美心开始============================================
Comps.jomooHome = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.jomooHomeList = config.jomooHomeList;
}

Comps.jomooHome.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {

        var compEleDiv = $("#"+compId+"_div");
        var compEleDiv1 = compEleDiv.find(".jomooHome-div").first();
        compEleDiv.empty();
        var jomooHomeList = that.jomooHomeList;
        if (jomooHomeList != null && jomooHomeList.length > 0) {
            for (var i = 0 ; i < jomooHomeList.length ; i++) {
                var compEleClone = compEleDiv1.clone();
                var jomooHome = jomooHomeList[i];
                if (jomooHome.imgSrc != '') {
                    compEleClone.find(".jomooHome-img").first().attr("src",jomooHome.imgSrc);
                }
                if (jomooHome.title != '') {
                    compEleClone.find(".jomooHome-title").first().html(jomooHome.title);
                }
                compEleDiv.append(compEleClone);
            }
        }

    }
    Utils.ajaxLoadComplate(that);
}
//====================================================家在美心结束============================================

//====================================================美心文体活动开始============================================
Comps.culturalActivity = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.culturalActivityList = config.culturalActivityList;
}

Comps.culturalActivity.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {

        var compEleDiv = $("#"+compId+"_div");
        var compEleDiv1 = compEleDiv.find(".culturalActivity-div").first();
        compEleDiv.empty();
        var culturalActivityList = that.culturalActivityList;
        if (culturalActivityList != null && culturalActivityList.length > 0) {
            for (var i = 0 ; i < culturalActivityList.length ; i++) {
                var compEleClone = compEleDiv1.clone();
                var culturalActivity = culturalActivityList[i];

                if (culturalActivity.jumpUrl != '') {
                    compEleClone.find(".culturalActivity-url").first().attr("href",culturalActivity.jumpUrl)
                        .attr("target","_blank");
                }

                if (culturalActivity.imgSrc != '') {
                    compEleClone.find(".culturalActivity-img").first().attr("src",culturalActivity.imgSrc);
                }

                compEleDiv.append(compEleClone);
            }
        }

    }
    that.bindEvent();
    Utils.ajaxLoadComplate(that);
}

Comps.culturalActivity.prototype.bindEvent = function() {
    if($(window).width() <= 992) {
        wapSwiper()
    }else {
        webSwiper()
    }

    $(window).resize(function () {
        if($(window).width() <= 992) {
            wapSwiper()
        }else {
            webSwiper()
        }
    })


    function webSwiper () {
        var swiper = new Swiper('.home-swiper-cont', {
            effect: 'coverflow',
            grabCursor: true,
            centeredSlides: true,
            slidesPerView: 'auto',
            initialSlide: 1,
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',
            coverflow: {
                rotate: 0,
                stretch: 0,
                depth: 200,
                modifier: 2,
                slideShadows : true
            }
        });
    }

    function wapSwiper () {
        var swiper = new Swiper('.home-swiper-cont', {
            centeredSlides: true,
            slidesPerView: 'auto',
            initialSlide: 1,
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',
        });
    }

}
//====================================================美心文体活动结束============================================

Comps.jomooBanner = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.jomooBannerList = config.jomooBannerList;
}

Comps.jomooBanner.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {


        var jomooBannerList = that.jomooBannerList;
        if (jomooBannerList != null && jomooBannerList.length > 0) {
            var jomooBanner = jomooBannerList[0];
            if (jomooBanner.jumpUrl != '') {
                $("#"+compId+"_a").attr("href",jomooBanner.jumpUrl)
                    .attr("target","_blank");
                $("#"+compId+"_mobile_a").attr("href",jomooBanner.jumpUrl)
                     .attr("target","_blank");
            } else {
                $("#"+compId+"_a").attr("href","/")
                     .attr("target","_blank");
            }

            if (jomooBanner.imgSrc != '') {
                $("#"+compId+"_img").attr("src",jomooBanner.imgSrc);
                $("#"+compId+"_mobile_img").attr("src",jomooBanner.imgSrc);
            }

            if (jomooBanner.imgSrc2 != '') {
                $("#"+compId+"_mobile_img").attr("src",jomooBanner.imgSrc2);
            }
        }

    }
    Utils.ajaxLoadComplate(that);
}



Comps.periodicalComp = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.periodicalList = config.periodicalList;
}

Comps.periodicalComp.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {

        var compEleRow = $("#"+compId+"_row");
        var compEleDiv = compEleRow.find(".periodicalComp-div").first();
        compEleRow.empty();
        var periodicalList = that.periodicalList;
        if (periodicalList != null && periodicalList.length > 0) {
            for (var i = 0 ; i < periodicalList.length ; i++) {
                var compEleClone = compEleDiv.clone();
                var periodical = periodicalList[i];
                if (periodical.imgSrc != '') {
                    compEleClone.find(".periodicalComp-img").first().attr("src",periodical.imgSrc);
                }
                if (periodical.title != '' && periodical.state == '') {
                    compEleClone.find(".periodicalComp-h6").first().html(periodical.title);
                }
                if (periodical.title != '' && periodical.state != '') {
                    compEleClone.find(".periodicalComp-h6").first().html(periodical.title+periodical.state);
                }
                if (periodical.time != '') {
                    compEleClone.find(".periodicalComp-time").first().html(periodical.time);
                }
            }
        }
    }
    Utils.ajaxLoadComplate(that);
}


Comps.mgazineBanner = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.slideshowSpeed = config.slideshowSpeed;
    this.animationDuration = config.animationDuration;
    this.magazineBannerList = config.magazineBannerList;
}

Comps.mgazineBanner.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {

        var compEleUl = $("#"+compId+"_ul");
        var compEleLi = compEleUl.find(".mgazineBanner-li").first();
        compEleUl.empty();
        var magazineBannerList = that.magazineBannerList;
        if (magazineBannerList != null && magazineBannerList.length > 0) {
            for (var i = 0 ; i < magazineBannerList.length ; i++) {

                var compEleClone = compEleLi.clone();
                var magazineBanner = magazineBannerList[i];

                if (magazineBanner.jumpUrl != '') {
                    compEleClone.find(".mgazineBanner-a").first().attr("href",magazineBanner.jumpUrl).attr("target","_blank");
                } else {
                    compEleClone.find(".mgazineBanner-a").first().attr("href","/").attr("target","_blank");
                }

                compEleClone.find(".mgazineBanner-img").first().attr("src",periodical.imgSrc);

                compEleUl.append(compEleClone);
            }
        }
    }
    that.bindEvent(that.slideshowSpeed,that.animationDuration);
    Utils.ajaxLoadComplate(that);
}

Comps.mgazineBanner.prototype.bindEvent = function(slideshowSpeed,animationDuration) {

    if (slideshowSpeed == '') {
        slideshowSpeed = 4000;
    }

    if (animationDuration == '') {
        animationDuration = 600;
    }

    $('.space_banner .flexslider').flexslider({
        controlsContainer:".slider_fullscreen_control",
        animation: "slide",
        controlNav: true,
        animationLoop: true,
        pauseOnAction: true,
        pauseOnHover: false,
        slideshowSpeed: slideshowSpeed,
        animationDuration: animationDuration,
        directionNav: true,
        start:function () {
    		$('.slider_cont img').css('opacity','1')
    	}
    });
}


//====================================================战略合作组件开始============================================
Comps.websitePartner = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.partnerList = config.partnerList;
}

Comps.websitePartner.prototype.init = function() {
	var that = this;
	var compId = this.compId;
	var partnerList2 = that.partnerList;
    if (this.needAsyncInit) {
        var compEleTab = $("#" + compId + "_tab");
        var compEleA = compEleTab.find(".websitePartner-a").first();
        compEleTab.empty();
        if (partnerList2 != null && partnerList2.length > 0) {
            for (var i = 0 ; i < partnerList2.length ; i++) {
                var websitePartner  =  partnerList2[i];
                var compEleAClone = compEleA.clone();
                if (i == 0) {
                    compEleAClone.addClass("active");
                }
                compEleAClone.html(websitePartner.name).attr("data-index",i);
                compEleTab.append(compEleAClone);
            }

            var websitePartner  =  partnerList2[0];
            var partnerList = websitePartner.websitePartnerList;

            var compEleDiv = $("#"+compId+"_div");
            var compEleDiv2 = compEleDiv.find(".websitePartner-div").first();
            compEleDiv.empty();

            if (partnerList != null && partnerList.length > 0) {
                for (var j = 0 ; j < partnerList.length ; j++) {
                    var partner = partnerList[j];
                    var compEleDivClone = compEleDiv2.clone();

                    if (partner.jumpUrl != '') {
                        compEleDivClone.find(".websitePartner-a2").first().attr("href",partner.jumpUrl).attr("target","_blank");
                    } else {
                        compEleDivClone.find(".websitePartner-a2").first().attr("href","/").attr("target","_blank");
                    }

                    if (partner.imgSrc != '') {
                        compEleDivClone.find(".websitePartner-img").first().attr("src",partner.imgSrc);
                    }

                    compEleDiv.append(compEleDivClone);
                }
            }

        }
    }
    that.bindEvent();
    Utils.ajaxLoadComplate(that);
}

Comps.websitePartner.prototype.bindEvent = function() {
    var that = this;
   	var compId = this.compId;
   	var partnerList2 = this.partnerList;
    $('.cop-icon-tabs .websitePartner-a').click(function(){
        var falg = $(this).hasClass("active");
        $(this).addClass('active').siblings().removeClass('active');
        var index = $(this).attr("data-index");
        if (!falg) {
            var websitePartner  =  partnerList2[index];
            var partnerList = websitePartner.websitePartnerList;

            var compEleDiv = $("#"+compId+"_div");
            var compEleDiv2 = compEleDiv.find(".websitePartner-div").first();
            compEleDiv.empty();

            if (partnerList != null && partnerList.length > 0) {
                for (var j = 0 ; j < partnerList.length ; j++) {
                    var partner = partnerList[j];
                    var compEleDivClone = compEleDiv2.clone();

                    if (partner.jumpUrl != '') {
                        compEleDivClone.find(".websitePartner-a2").first().attr("href",partner.jumpUrl).attr("target","_blank");
                    } else {
                        compEleDivClone.find(".websitePartner-a2").first().attr("href","/").attr("target","_blank");
                    }

                    if (partner.imgSrc != '') {
                        compEleDivClone.find(".websitePartner-img").first().attr("src",partner.imgSrc);
                    }

                    compEleDiv.append(compEleDivClone);
                }
            }
        }
    })
}

//====================================================战略合作组件开始============================================



//##########内刊列表组件###########
Comps.magazineList = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.magazineUrl = config.magazineUrl;
}

Comps.magazineList.prototype.init = function() {
    var that = this ;
    if (this.needAsyncInit) {
        that.ajaxLoadData();
    }
    Utils.ajaxLoadComplate(that);
    that._bindEvent();
}

Comps.magazineList.prototype.ajaxLoadData = function () {
    var ts = this;
    var compId = this.compId;
    $.ajax({
        "url": ContextPath+"/magazineList/ajaxLoadData.json",
        "data" : {},
        "success": function (data) {
            var compEleRow = $("#"+compId+"_row");
            var compEleDiv = compEleRow.find(".magazineList-div").first();
            compEleRow.empty();
            var magazineList = data.magazinePageModel.magazineList;
            if(magazineList != null && magazineList.length > 0){
                for(var i = 0;i < magazineList.length; i++){
                    var magazine = magazineList[i];
                    var compEleClone = compEleDiv.clone();
                    if (magazine.imageUrl != '') {
                        compEleClone.find(".magazineList-img").first().attr("src",magazine.imageUrl);
                    }

                    compEleClone.find(".magazineList-title").first().html(magazine.title);
                    compEleClone.find(".magazineList-remake").first().html(magazine.description);
                    compEleClone.find(".magazineList-time").first().html(magazine.time);
                    compEleClone.find(".magazineList-a").first().attr("href",ts.magazineUrl+"/"+magazine.uuid).attr("target","_blank");
                    compEleRow.append(compEleClone);
                }

                var page = 0;
                var totalPage = data.magazinePageModel.totalNum ;
                var page1 = data.magazinePageModel.pageShow ;
                if(parseInt(totalPage)%parseInt(page1) == 0){
                    page = (parseInt)(totalPage/page1);
                }else{
                    page = (parseInt)(totalPage/page1)+parseInt(1);
                }
                $("#"+compId+"_page").html("");

                var html = "<div class='t-page-change'><div style='display: inline-block'><span><a href='javascript:;'>首页</a></span>" +
                                        "<span><a href='javascript:;'>上一页</a></span><ul class='clearfix'>";
                for(var i=1 ; i <= page ; i++){
                    if(page <= 4){
                        if(i == 1){
                            html += "<li class='active'><a href='javascript:;'>1</a></li>";
                        }else if(i == 2){
                            html += "<li><a href='javascript:;'>2</a></li>";
                        }else if(i == 3){
                            html += "<li><a href='javascript:;'>3</a></li>";
                        }else{
                            html += "<li><a href='javascript:;'>4</a></li>";
                        }
                    }else{
                        if(i == 1){
                            html += "<li class='active'><a href='javascript:;'>1</a></li>";
                        }else if(i == 2){
                            html += "<li><a href='javascript:;'>2</a></li>";
                        }else if(i == 3){
                            html += "<li><a href='javascript:;'>3</a></li>";
                        }else{
                            html += "<span class='y_spit'>...</span>";
                            html += "<li><a href='javascript:;'>"+i+"</a></li>";
                        }
                    }
                }
                if(page == 1){
                    html1 += "<a class='next_btn y_btn disabled' href='javascript:void(0);' title='下一页'>下一页</a>" +
                            "<a class='end_btn y_btn disabled' href='javascript:void(0);' title='尾页'>尾页</a>" ;
                }else{
                    html1 += "<a class='next_btn y_btn' href='javascript:void(0);' title='下一页'>下一页</a>" +
                            "<a class='end_btn y_btn' href='javascript:void(0);' title='尾页'>尾页</a>" ;
                }
                html +="</ul><span><a href='javascript:;'>上一页</a></span><span><a href='javascript:;'>尾页</a></span>" +
                                        "<div class='t-right-put'><i>共"+page+"页&nbsp;到第</i><input type='text'><i>页</i> </div></div></div></div></div>";
                div.html(html);
            }else{
                compEleRow.html("暂无内刊发布！");
                $("#"+compId+"_page").html("");
            }
            ts._bindEvent();
        }
    });
}

Comps.magazineList.prototype.loadData = function (option) {
    var ts = this;
    var compId = this.compId;

    $.ajax({
        "url": ContextPath+"/magazineList/ajaxLoadData.json",
        "data" : option,
        "success": function (data) {
            var compEleRow = $("#"+compId+"_row");
            var compEleDiv = compEleRow.find(".magazineList-div").first();
            compEleRow.empty();
            var magazineList = data.magazinePageModel.magazineList;
            if(magazineList != null && magazineList.length > 0){
                for(var i = 0;i < magazineList.length; i++){
                    var magazine = magazineList[i];
                    var compEleClone = compEleDiv.clone();
                    if (magazine.imageUrl != '') {
                        compEleClone.find(".magazineList-img").first().attr("src",magazine.imageUrl);
                    }

                    compEleClone.find(".magazineList-title").first().html(magazine.title);
                    compEleClone.find(".magazineList-remake").first().html(magazine.description);
                    compEleClone.find(".magazineList-time").first().html(magazine.time);
                    compEleClone.find(".magazineList-a").first().attr("href",ts.magazineUrl+"/"+magazine.uuid).attr("target","_blank");
                    compEleRow.append(compEleClone);
                }

            }else{
                compEleRow.html("暂无内刊发布！");
                $("#"+compId+"_page").html("");
            }
        }
    });
}

Comps.magazineList.prototype._bindEvent = function () {
    var ts = this;
    var totalPage = $("#totalPage").val();

    /*首页按钮*/
    $(".first_btn").click(function(){
        var option ={"nowPage":"1"};
        ts.loadData(option);
        $(".magazineList-ul .magazineList-li").each(function(i){
            $(this).removeClass("active");
            if ($(this).find("a").text() == 1) {
               $(this).addClass("active");
            }
        });
    });

    /*上一页按钮*/
    $(".last_btn").click(function(){
        var nowPage = $(".magazineList-ul .active").attr("data-page");
        var page = nowPage-1;
        if(page <= 0){
            page = 1 ;
        }
        var option ={"nowPage":page};
        ts.loadData(option);

        $(".magazineList-ul .magazineList-li").each(function(i){
            $(this).removeClass("active");
            if ($(this).find("a").text() == page) {
               $(this).addClass("active");
            }
        });
    });

    /*页数按钮*/
    $(".magazineList-ul .magazineList-li").click(function(){
        var nowPage = $(this).find("a").text();
        var option ={"nowPage":nowPage};
        ts.loadData(option);
        $(this).addClass("active").siblings().removeClass("active");
    });

    /*下一页按钮*/
    $(".next_btn").click(function(){
        var nowPage = $(".magazineList-ul .active").attr("data-page");
        var page = parseInt(nowPage)+parseInt(1);
        if((parseInt(nowPage)+parseInt(1)) >= totalPage){
            page = totalPage ;
        }
        $(".magazineList-ul .magazineList-li").removeClass("active");
                $(".magazineList-ul .magazineList-li").eq(page-1).addClass("active");
        var option ={"nowPage":page};
        ts.loadData(option);


    });

    /*尾页按钮*/
    $(".end_btn").click(function(){
        var option ={"nowPage":totalPage};
        ts.loadData(option);
        $(".magazineList-ul .magazineList-li").each(function(i){
            $(this).removeClass("active");
            if ($(this).find("a").text() == totalPage) {
               $(this).addClass("active");
            }
        });
    });

    $(document).keydown(function(event){
　　    if(event.keyCode==13){
            var nowPage = $("#page-page").val();
            var integernum = /^[1-9]\d*$/;
            if (!integernum.test(nowPage)) {
                alert("请填写正确页码!");
                return;
            }
            if (parseInt(nowPage) > parseInt(totalPage) || parseInt(nowPage) < 0) {
                alert("页码数错误!");
                return;
            }
            var option ={"nowPage":nowPage};
            ts.loadData(option);
            $(".magazineList-ul .magazineList-li").each(function(i){
                $(this).removeClass("active");
                if ($(this).find("a").text() == nowPage) {
                   $(this).addClass("active");
                }
            });
        }
    })
}
//##########内刊列表组件###########


//##########公益活动组件###########
Comps.welfareActivities = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.welfareActivitiesList = config.welfareActivitiesList;
}

Comps.welfareActivities.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {

        var compEleUl = $("#"+compId+"_ul");
        var compEleLi = compEleUl.find(".welfareActivities-li").first();
        compEleUl.empty();
        var welfareActivitiesList = that.welfareActivitiesList;
        if (welfareActivitiesList != null && welfareActivitiesList.length > 0) {
            for (var i = 0 ; i < welfareActivitiesList.length ; i++) {

                var compEleClone = compEleLi.clone();
                var welfare = welfareActivitiesList[i];

                if (welfare.title != '') {
                    compEleClone.find(".welfareActivities-h3").html(welfare.title);
                }

                if (welfare.introduction != '') {
                    compEleClone.find(".welfareActivities-p").html(welfare.introduction);
                }

                if (welfare.imgSrc != '') {
                    compEleClone.find(".welfareActivities-img").attr("src",welfare.imgSrc);
                }
                compEleUl.append(compEleClone);
            }
        }
    }
    Utils.ajaxLoadComplate(that);
}
//##########公益活动组件###########


//##########全部荣誉(新)组件###########
Comps.websiteAllHonor = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.websiteAllHonorList = config.websiteAllHonorList;
}

Comps.websiteAllHonor.prototype.init = function() {
	var that = this;
	var compId = this.compId;
	var websiteAllHonorList = that.websiteAllHonorList;
    if (this.needAsyncInit) {
        var compEleTab = $("#" + compId + "_tab");
        var compEleA = compEleTab.find(".websiteAllHonor-a").first();
        compEleTab.empty();
        if (websiteAllHonorList != null && websiteAllHonorList.length > 0) {
            for (var i = 0 ; i < websiteAllHonorList.length ; i++) {
                var websiteHonor = websiteAllHonorList[i];
                var compEleAClone = compEleA.clone();
                if (i == 0) {
                    compEleAClone.addClass("active");
                }
                compEleAClone.html(websiteHonor.name).attr("data-index",i);
                compEleTab.append(compEleAClone);
            }

            var websiteHonor  =  websiteAllHonorList[0];
            var allHonorList = websiteHonor.allHonorList;

            var compEleDiv = $("#"+compId+"_div");
            var compEleDiv2 = compEleDiv.find(".websiteAllHonor-div").first();
            compEleDiv.empty();

            if (allHonorList != null && allHonorList.length > 0) {
                for (var j = 0 ; j < allHonorList.length ; j++) {
                    var honor = allHonorList[j];
                    var compEleDivClone = compEleDiv2.clone();

                    if (honor.imgSrc != '') {
                        compEleDivClone.find(".websiteAllHonor-img").first().attr("src",honor.imgSrc);
                    }

                    if (honor.name != '') {
                        compEleDivClone.find(".websiteAllHonor-name").first().html(honor.name);
                    }

                    if (honor.remark != '') {
                        compEleDivClone.find(".websiteAllHonor-remark").first().html(honor.remark);
                    }
                    compEleDiv.append(compEleDivClone);
                }
            }

        }
    }
    that.bindEvent();
    Utils.ajaxLoadComplate(that);
}

Comps.websiteAllHonor.prototype.bindEvent = function() {
    var that = this;
   	var compId = this.compId;
   	var websiteAllHonorList = this.websiteAllHonorList;
    $('.cop-icon-tabs .websiteAllHonor-a').click(function(){
        var falg = $(this).hasClass("active");
        $(this).addClass('active').siblings().removeClass('active');
        var index = $(this).attr("data-index");
        if (!falg) {
            var websiteHonor = websiteAllHonorList[index];
            var allHonorList = websiteHonor.allHonorList;

            var compEleDiv = $("#"+compId+"_div");
            var compEleDiv2 = compEleDiv.find(".websiteAllHonor-div").first();
            compEleDiv.empty();

            if (allHonorList != null && allHonorList.length > 0) {
                for (var j = allHonorList.length -1 ; j >= 0  ; j--) {
                    var honor = allHonorList[j];
                    var compEleDivClone = compEleDiv2.clone();

                    if (honor.imgSrc != '') {
                        compEleDivClone.find(".websiteAllHonor-img").first().attr("src",honor.imgSrc);
                    }

                    if (honor.name != '') {
                        compEleDivClone.find(".websiteAllHonor-name").first().html(honor.name);
                    }

                    if (honor.remark != '') {
                        compEleDivClone.find(".websiteAllHonor-remark").first().html(honor.remark);
                    }
                    compEleDiv.append(compEleDivClone);
                }
            }
        }
    })
}


//##########校园招聘组件###########
Comps.schoolRecruit = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.schoolRecruitList = config.schoolRecruitList;
}

Comps.schoolRecruit.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {

        var compEleRow = $("#"+compId+"_row");
        var compEleDiv = compEleRow.find(".schoolRecruit-div").first();
        compEleRow.empty();
        var schoolRecruitList = that.schoolRecruitList;
        if (schoolRecruitList != null && schoolRecruitList.length > 0) {
            for (var i = 0 ; i < schoolRecruitList.length ; i++) {

                var compEleClone = compEleDiv.clone();
                var schoolRecruit = schoolRecruitList[i];

                if (schoolRecruit.jumpUrl != '') {
                    compEleClone.find(".schoolRecruit-a").first().attr("href",schoolRecruit.jumpUrl).attr("target","_blank");
                }

                if (schoolRecruit.imgSrc != '') {
                    compEleClone.find(".schoolRecruit-img").first().attr("src",schoolRecruit.imgSrc);

                }

                if (schoolRecruit.name != '') {
                    compEleClone.find(".schoolRecruit-name").first().html(schoolRecruit.name);
                }

                compEleRow.append(compEleClone);
            }
        }
    }
    Utils.ajaxLoadComplate(that);
}
//##########校园招聘组件###########

//#########岗位类型组件###########
Comps.postType = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.title = config.title;
    this.postTypeList = config.postTypeList;
}

Comps.postType.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {

        if (that.title != '') {
            $("#"+compId+"_title").html(that.title);
        }

        var compEleOl = $("#"+compId+"_ol");
        var compEleLi = compEleOl.find(".postType-li").first();
        compEleOl.empty();

        var postTypeList = that.postTypeList;
        if (postTypeList != null && postTypeList.length > 0) {
            for (var i = 0 ; i < postTypeList.length ; i++) {
                var postType = postTypeList[i];
                var compEleClone = compEleLi.clone();
                var flag = parseInt(i) +1;
                var typeClass = "post-selection-icon"+flag;
                compEleClone.find(".postType-icon").removeClass("post-selection-icon1").addClass(typeClass);

                if (postType.name != '') {
                    compEleClone.find(".postType-name").html(postType.name);
                }

                if (postType.jumpUrl != '') {
                    compEleClone.find(".postType_a").attr("href",postType.jumpUrl)
                        .attr("target","_blank");
                }

                compEleOl.append(compEleClone);
            }
        }
    }
    Utils.ajaxLoadComplate(that);
}
//##########校园招聘组件###########


//#########岗位类型组件###########
Comps.delivery = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.imgSrc = config.imgSrc;
    this.title = config.title;
    this.jumpUrl = config.jumpUrl
}

Comps.delivery.prototype.init = function() {
	var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {
        if (that.jumpUrl != '') {
            $("#"+compId+"_a").attr("href",that.jumpUrl).attr("target","_blank");
        }
        if (that.title != '') {
            $("#"+compId+"_title").html(that.title);
        }
        if (that.imgSrc != '') {
            $("#"+compId+"_img").html(that.imgSrc);
        }

    }
    Utils.ajaxLoadComplate(that);
}
//##########岗位类型组件###########

//##########官网品牌新闻组件 start###########

Comps.websiteBrandNew = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
	this.moreUrl = config.moreUrl;
    this.detailsUrl = config.detailsUrl;
    this.websiteBrandNewList = config.websiteBrandNewList
}

Comps.websiteBrandNew.prototype.init = function() {
    $('.band_slider .flexslider').flexslider({
            controlsContainer:".slider_fullscreen_control",
            animation: "slide",
            animationLoop: false,
            slideshow: false,
            pauseOnAction: true,
            pauseOnHover: false,
            animationDuration: 600,
            directionNav: true,
    })

    if($(window).width() > 992) {
        var winH = $(window).height();
        $('.band-banner').height(winH - 80 - 64).css({'overflow':'hidden'})
    }
    Utils.ajaxLoadComplate(that);
}

//##########官网品牌新闻组件 end#############




Comps.autoService = function(config){
	this.compId = config.compId;
	this.needAsyncInit = config.needAsyncInit;
    this.autoServiceList = config.autoServiceList
}

Comps.autoService.prototype.init = function() {
    var that =this;
    var compId = this.compId;
    Utils.ajaxLoadComplate(that);
}


Comps.contactUsAd = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.imgSrc = config.imgSrc;
    this.mobileImgSrc = config.mobileImgSrc;

}

Comps.contactUsAd.prototype.init = function() {
    var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {
        if (this.imgSrc != '') {
            $(".contactUsAd_img").attr("src",this.imgSrc);
        }
        if (this.mobileImgSrc != '') {
            $(".contactUsAd_moblie_img").attr("src",this.mobileImgSrc);
        }
    }
}


Comps.contactUsTitle = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.title = config.title;
    this.remark = config.remark;

}

Comps.contactUsTitle.prototype.init = function() {
    var that =this;
	var compId = this.compId;
    if (this.needAsyncInit) {
        if (this.title != '') {
            $(".contactUs_title").html(this.title);
            $(".contactUs_mobile_title").html(this.title);
        }
        if (this.remark != '') {
            $(".contactUs_title").html(this.title);
            $(".contactUs_mobile_title").html(this.title);
        }
    }
}


Comps.websiteContactUs = function(config){
	this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.websiteContactUsList = config.websiteContactUsList;

}

Comps.websiteContactUs.prototype.init = function() {
    var that =this;
	var compId = this.compId;
    $(".websiteContactUs_code").click(function(){
        $(".contan-float").show();
    });
    $(".contan-float").click(function () {
        $(this).hide();
    });
    $(".websiteContactUs_us").click(function(){
        $('.flat-pic').addClass('shower');
    });
    $('.flat-pic').click(function () {
        $(this).removeClass('shower')
    });
}
